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: <1431761914-20677-2-git-send-email-green@linuxhacker.ru>
Date:	Sat, 16 May 2015 03:38:31 -0400
From:	green@...uxhacker.ru
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	devel@...verdev.osuosl.org,
	Andreas Dilger <andreas.dilger@...el.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Oleg Drokin <green@...uxhacker.ru>
Subject: [PATCH 1/4] staging/lustre: Only set INTERRUPTIBLE state before calling schedule

From: Oleg Drokin <green@...uxhacker.ru>

In __l_wait_event the condition could be a complicated function that does
allocations and other potentialy blocking activities, so it sohuld
not be called in a task state other than RUNNABLE

Signed-off-by: Oleg Drokin <green@...uxhacker.ru>
---
 drivers/staging/lustre/lustre/include/lustre_lib.h | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h
index bf13563..43ee9f0 100644
--- a/drivers/staging/lustre/lustre/include/lustre_lib.h
+++ b/drivers/staging/lustre/lustre/include/lustre_lib.h
@@ -549,19 +549,13 @@ do {									   \
 		__blocked = cfs_block_sigsinv(0);			      \
 									       \
 	for (;;) {							     \
-		unsigned       __wstate;				       \
-									       \
-		__wstate = info->lwi_on_signal != NULL &&		      \
-			   (__timeout == 0 || __allow_intr) ?		  \
-			TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE;	       \
-									       \
-		set_current_state(TASK_INTERRUPTIBLE);		 \
-									       \
 		if (condition)						 \
 			break;						 \
 									       \
+		set_current_state(TASK_INTERRUPTIBLE);			       \
+									       \
 		if (__timeout == 0) {					  \
-			schedule();						\
+			schedule();					       \
 		} else {						       \
 			long interval = info->lwi_interval?	  \
 					     min_t(long,	     \
@@ -582,6 +576,8 @@ do {									   \
 			}						      \
 		}							      \
 									       \
+		set_current_state(TASK_RUNNING);			       \
+									       \
 		if (condition)						 \
 			break;						 \
 		if (cfs_signal_pending()) {				    \
@@ -605,7 +601,6 @@ do {									   \
 									       \
 	cfs_restore_sigs(__blocked);					   \
 									       \
-	set_current_state(TASK_RUNNING);			       \
 	remove_wait_queue(&wq, &__wait);					   \
 } while (0)
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ