mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
um: allocate a guard page to helper threads
We've been running into stack overflows in helper threads corrupting memory (e.g. because somebody put printf() or os_info() there), so to avoid those causing hard-to-debug issues later on, allocate a guard page for helper thread stacks and mark it read-only. Unfortunately, the crash dump at that point is useless as the stack tracer will try to backtrace the *kernel* thread, not the helper thread, but at least we don't survive to a random issue caused by corruption. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
committed by
Richard Weinberger
parent
963285b0b4
commit
ef4459a6da
@@ -19,7 +19,7 @@ extern int kmalloc_ok;
|
||||
#define UML_ROUND_UP(addr) \
|
||||
((((unsigned long) addr) + PAGE_SIZE - 1) & PAGE_MASK)
|
||||
|
||||
extern unsigned long alloc_stack(int order, int atomic);
|
||||
extern unsigned long alloc_stack(int atomic);
|
||||
extern void free_stack(unsigned long stack, int order);
|
||||
|
||||
struct pt_regs;
|
||||
|
||||
Reference in New Issue
Block a user