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-next>] [day] [month] [year] [list]
Message-ID: <20220616134042.130002-1-chenjun102@huawei.com>
Date:   Thu, 16 Jun 2022 13:40:42 +0000
From:   Chen Jun <chenjun102@...wei.com>
To:     <linux-kernel@...r.kernel.org>, <mingo@...hat.com>,
        <peterz@...radead.org>, <will@...nel.org>
CC:     <xuqiang36@...wei.com>
Subject: [PATCH 1/1] lockdep: pass curr_inner to print_lock_invalid_wait_context

Same information (task_wait_context(curr)) is printed twice.
curr_inner in check_wait_context is what we need.

Signed-off-by: Chen Jun <chenjun102@...wei.com>
---
 kernel/locking/lockdep.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 81e87280513e..2eb9802df7b9 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4676,10 +4676,8 @@ static inline short task_wait_context(struct task_struct *curr)
 
 static int
 print_lock_invalid_wait_context(struct task_struct *curr,
-				struct held_lock *hlock)
+				struct held_lock *hlock, short curr_inner)
 {
-	short curr_inner;
-
 	if (!debug_locks_off())
 		return 0;
 	if (debug_locks_silent)
@@ -4695,9 +4693,7 @@ print_lock_invalid_wait_context(struct task_struct *curr,
 	print_lock(hlock);
 
 	pr_warn("other info that might help us debug this:\n");
-
-	curr_inner = task_wait_context(curr);
-	pr_warn("context-{%d:%d}\n", curr_inner, curr_inner);
+	pr_warn("context-{%d:%d}\n", curr_inner, task_wait_context(curr));
 
 	lockdep_print_held_locks(curr);
 
@@ -4763,7 +4759,7 @@ static int check_wait_context(struct task_struct *curr, struct held_lock *next)
 	}
 
 	if (next_outer > curr_inner)
-		return print_lock_invalid_wait_context(curr, next);
+		return print_lock_invalid_wait_context(curr, next, curr_inner);
 
 	return 0;
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ