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]
Date: Fri, 5 Jan 2024 14:04:56 +0800
From: Xuewen Yan <xuewen.yan@...soc.com>
To: <peterz@...radead.org>, <mingo@...hat.com>, <will@...nel.org>,
        <boqun.feng@...il.com>
CC: <longman@...hat.com>, <zhiguo.niu@...soc.com>, <ke.wang@...soc.com>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH v2] lockdep: Add missing graph_unlock in check_prev_add

The check_prev_add() is held graph_lock, and it should unlock
the graph_lock before return 0.
But there is one condition where it will return 0 without unlock,
that is:

/* <prev> is not found in <next>::locks_before */
	return 0;

So add graph_unlock before return 0.

Fixes: 3454a36d6a39 ("lockdep: Introduce lock_list::dep")
Signed-off-by: Xuewen Yan <xuewen.yan@...soc.com>
Signed-off-by: Zhiguo Niu <zhiguo.niu@...soc.com>
---
Change in V2:
-move the graph_unlock to check_prev_add from validate_chain(Boqun)
-Add fix tag
---
---
 kernel/locking/lockdep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 151bd3de5936..c8602a251bec 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -3178,6 +3178,7 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev,
 			}
 
 			/* <prev> is not found in <next>::locks_before */
+			graph_unlock();
 			return 0;
 		}
 	}
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ