lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-7e8e6816c6495a1168f9a7a50125d82c23e59300@git.kernel.org>
Date:   Wed, 3 Jul 2019 00:07:19 -0700
From:   tip-bot for Thomas Gleixner <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     rostedt@...dmis.org, tglx@...utronix.de, hpa@...or.com,
        peterz@...radead.org, linux-kernel@...r.kernel.org,
        mark.rutland@....com, mingo@...nel.org, jpoimboe@...hat.com
Subject: [tip:core/stacktrace] stacktrace: Use PF_KTHREAD to check for
 kernel threads

Commit-ID:  7e8e6816c6495a1168f9a7a50125d82c23e59300
Gitweb:     https://git.kernel.org/tip/7e8e6816c6495a1168f9a7a50125d82c23e59300
Author:     Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Tue, 2 Jul 2019 17:53:35 +0200
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 3 Jul 2019 09:04:06 +0200

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@...utronix.de>
Acked-by: Mark Rutland <mark.rutland@....com>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1907021750100.1802@nanos.tec.linutronix.de

---
 kernel/stacktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c
index 36139de0a3c4..c8d0f05721a1 100644
--- a/kernel/stacktrace.c
+++ b/kernel/stacktrace.c
@@ -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));

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ