/* * Check that the poison value points to the unused hole in the * virtual memory map for your platform.
*/ #define KSTACK_ERASE_POISON -0xBEEF #define KSTACK_ERASE_SEARCH_DEPTH 128
/* * The lowest address on tsk's stack which we can plausibly erase.
*/ static __always_inline unsignedlong
stackleak_task_low_bound(conststruct task_struct *tsk)
{ /* * The lowest unsigned long on the task stack contains STACK_END_MAGIC, * which we must not corrupt.
*/ return (unsignedlong)end_of_stack(tsk) + sizeof(unsignedlong);
}
/* * The address immediately after the highest address on tsk's stack which we * can plausibly erase.
*/ static __always_inline unsignedlong
stackleak_task_high_bound(conststruct task_struct *tsk)
{ /* * The task's pt_regs lives at the top of the task stack and will be * overwritten by exception entry, so there's no need to erase them.
*/ return (unsignedlong)task_pt_regs(tsk);
}
/* * Find the address immediately above the poisoned region of the stack, where * that region falls between 'low' (inclusive) and 'high' (exclusive).
*/ static __always_inline unsignedlong
stackleak_find_top_of_poison(constunsignedlong low, constunsignedlong high)
{ constunsignedint depth = KSTACK_ERASE_SEARCH_DEPTH / sizeof(unsignedlong); unsignedint poison_count = 0; unsignedlong poison_high = high; unsignedlong sp = high;
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 ist noch experimentell.