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] [thread-next>] [day] [month] [year] [list]
Message-ID: <158195404815.13786.1421372964572283195.tip-bot2@tip-bot2>
Date:   Mon, 17 Feb 2020 15:40:48 -0000
From:   "tip-bot2 for Amol Grover" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Amol Grover <frextrite@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>, x86 <x86@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: [tip: timers/core] posix-timers: Pass lockdep expression to RCU lists

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     9ea9c60fc23c35f865725ab390ca4308de919bb0
Gitweb:        https://git.kernel.org/tip/9ea9c60fc23c35f865725ab390ca4308de919bb0
Author:        Amol Grover <frextrite@...il.com>
AuthorDate:    Sun, 16 Feb 2020 13:13:30 +05:30
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Mon, 17 Feb 2020 16:39:28 +01:00

posix-timers: Pass lockdep expression to RCU lists

head is traversed using hlist_for_each_entry_rcu outside an RCU read-side
critical section but under the protection of hash_lock.

Hence, add corresponding lockdep expression to silence false-positive
lockdep warnings, and harden RCU lists.

[ tglx: Removed the macro and put the condition right where it's used ]

Signed-off-by: Amol Grover <frextrite@...il.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Link: https://lkml.kernel.org/r/20200216074330.GA14025@workstation-portable

---
 kernel/time/posix-timers.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index ff0eb30..07709ac 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -121,7 +121,8 @@ static struct k_itimer *__posix_timers_find(struct hlist_head *head,
 {
 	struct k_itimer *timer;
 
-	hlist_for_each_entry_rcu(timer, head, t_hash) {
+	hlist_for_each_entry_rcu(timer, head, t_hash,
+				 lockdep_is_held(&hash_lock)) {
 		if ((timer->it_signal == sig) && (timer->it_id == id))
 			return timer;
 	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ