/* * Is sp valid as the address of the next kernel stack frame after prev_sp? * The next frame may be in a different stack area but should not go * back down in the same stack area.
*/ staticint valid_next_sp(unsignedlong sp, unsignedlong prev_sp)
{ if (sp & 0xf) return 0; /* must be 16-byte aligned */ if (!validate_sp(sp, current)) return 0; if (sp >= prev_sp + STACK_FRAME_MIN_SIZE) return 1; /* * sp could decrease when we jump off an interrupt stack * back to the regular process stack.
*/ if ((sp & ~(THREAD_SIZE - 1)) != (prev_sp & ~(THREAD_SIZE - 1))) return 1; return 0;
}
/* * We can't tell which of the first two addresses * we get are valid, but we can filter out the * obviously bogus ones here. We replace them * with 0 rather than removing them entirely so * that userspace can tell which is which.
*/ if ((level == 1 && next_ip == lr) ||
(level <= 1 && !kernel_text_address(next_ip)))
next_ip = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.