]> Git Repo - linux.git/commitdiff
stacktrace: Use PF_KTHREAD to check for kernel threads
authorThomas Gleixner <[email protected]>
Tue, 2 Jul 2019 15:53:35 +0000 (17:53 +0200)
committerThomas Gleixner <[email protected]>
Wed, 3 Jul 2019 07:04:06 +0000 (09:04 +0200)
!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 <[email protected]>
Acked-by: Mark Rutland <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
kernel/stacktrace.c

index 36139de0a3c4bcb7ba7da936a8d43fba08aa5929..c8d0f05721a1100cd2e77020ae07f6d553c95501 100644 (file)
@@ -228,7 +228,7 @@ unsigned int stack_trace_save_user(unsigned long *store, unsigned int size)
        };
 
        /* Trace user stack if not a kernel thread */
-       if (!current->mm)
+       if (current->flags & PF_KTHREAD)
                return 0;
 
        arch_stack_walk_user(consume_entry, &c, task_pt_regs(current));
This page took 0.061506 seconds and 4 git commands to generate.