mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 06:04:23 +08:00
stacktrace: Use PF_KTHREAD to check for kernel threads
!current->mm is not a reliable indicator for kernel threads as they might temporarily use a user mm. Check for PF_KTHREAD instead. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Mark Rutland <mark.rutland@arm.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1907021750100.1802@nanos.tec.linutronix.de
This commit is contained in:
parent
6fbc7275c7
commit
7e8e6816c6
@ -228,7 +228,7 @@ unsigned int stack_trace_save_user(unsigned long *store, unsigned int size)
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Trace user stack if not a kernel thread */
|
/* Trace user stack if not a kernel thread */
|
||||||
if (!current->mm)
|
if (current->flags & PF_KTHREAD)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
arch_stack_walk_user(consume_entry, &c, task_pt_regs(current));
|
arch_stack_walk_user(consume_entry, &c, task_pt_regs(current));
|
||||||
|
Loading…
Reference in New Issue
Block a user