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: <20230724160337.20851-1-dave@stgolabs.net>
Date:   Mon, 24 Jul 2023 09:03:36 -0700
From:   Davidlohr Bueso <dave@...olabs.net>
To:     peterz@...radead.org, mingo@...nel.org
Cc:     dave@...olabs.net, linux-kernel@...r.kernel.org
Subject: [PATCH] rcuwait: Add might_sleep() annotations

... as with regular waitqueues.

Signed-off-by: Davidlohr Bueso <dave@...olabs.net>
---
 include/linux/rcuwait.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/linux/rcuwait.h b/include/linux/rcuwait.h
index 27343424225c..c0fcac903d03 100644
--- a/include/linux/rcuwait.h
+++ b/include/linux/rcuwait.h
@@ -74,7 +74,10 @@ extern void finish_rcuwait(struct rcuwait *w);
 })
 
 #define rcuwait_wait_event(w, condition, state)				\
-	___rcuwait_wait_event(w, condition, state, 0, schedule())
+do {									\
+	might_sleep();							\
+	___rcuwait_wait_event(w, condition, state, 0, schedule());	\
+} while (0)
 
 #define __rcuwait_wait_event_timeout(w, condition, state, timeout)	\
 	___rcuwait_wait_event(w, ___wait_cond_timeout(condition),	\
@@ -84,6 +87,7 @@ extern void finish_rcuwait(struct rcuwait *w);
 #define rcuwait_wait_event_timeout(w, condition, state, timeout)	\
 ({									\
 	long __ret = timeout;						\
+	might_sleep();							\
 	if (!___wait_cond_timeout(condition))				\
 		__ret = __rcuwait_wait_event_timeout(w, condition,	\
 						     state, timeout);	\
-- 
2.41.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ