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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 8 Apr 2007 22:20:47 +0400
From:	Oleg Nesterov <>
To:	Andrew Morton <>
Cc:	Srivatsa Vaddagiri <>,
	Gautham R Shenoy <>,
	"Rafael J. Wysocki" <>,
Subject: [PATCH] worker_thread: fix racy try_to_freeze() usage

worker_thread() can miss freeze_process()->signal_wake_up() if it happens
between try_to_freeze() and prepare_to_wait(). We should check freezing()
before entering schedule().

This race was introduced by me in

	[PATCH 1/1] workqueue: don't migrate pending works from the dead CPU

Looks like mm/vmscan.c:kswapd() has the same race.

Signed-off-by: Oleg Nesterov <>

--- 2.6.21-rc5-mm4/kernel/workqueue.c~wq_freeze	2007-04-07 20:11:14.000000000 +0400
+++ 2.6.21-rc5-mm4/kernel/workqueue.c	2007-04-08 21:37:43.000000000 +0400
@@ -307,14 +307,14 @@ static int worker_thread(void *__cwq)
 	do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
 	for (;;) {
-		if (cwq->wq->freezeable)
-			try_to_freeze();
 		prepare_to_wait(&cwq->more_work, &wait, TASK_INTERRUPTIBLE);
-		if (!cwq->should_stop && list_empty(&cwq->worklist))
+		if (!freezing(current) && !cwq->should_stop
+		    && list_empty(&cwq->worklist))
 		finish_wait(&cwq->more_work, &wait);
+		try_to_freeze();
 		if (cwq_should_stop(cwq))

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists