* [PATCH] stop_machine: fix race with return value (fixes Bug #11989)
@ 2008-11-16 21:52 Rusty Russell
2008-11-17 9:46 ` Heiko Carstens
0 siblings, 1 reply; 2+ messages in thread
From: Rusty Russell @ 2008-11-16 21:52 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel, Heiko Carstens, Rafael J. Wysocki
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1148 bytes --]
Bug #11989: Suspend failure on NForce4-based boards due to chanes in stop_machine
We should not access active.fnret outside the lock; in theory the nextstop_machine could overwrite it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>Tested-by: "Rafael J. Wysocki" <rjw@sisk.pl>--- kernel/stop_machine.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff -r d7c9a15da615 kernel/stop_machine.c--- a/kernel/stop_machine.c Mon Nov 10 09:47:45 2008 +1100+++ b/kernel/stop_machine.c Tue Nov 11 23:19:47 2008 +1030@@ -112,7 +112,7 @@ int __stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus) { struct work_struct *sm_work;- int i;+ int i, ret; /* Set up initial state. */ mutex_lock(&lock);@@ -137,8 +137,9 @@ /* This will release the thread on our CPU. */ put_cpu(); flush_workqueue(stop_machine_wq);+ ret = active.fnret; mutex_unlock(&lock);- return active.fnret;+ return ret; } int stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus)\0ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] stop_machine: fix race with return value (fixes Bug #11989)
2008-11-16 21:52 [PATCH] stop_machine: fix race with return value (fixes Bug #11989) Rusty Russell
@ 2008-11-17 9:46 ` Heiko Carstens
0 siblings, 0 replies; 2+ messages in thread
From: Heiko Carstens @ 2008-11-17 9:46 UTC (permalink / raw)
To: Rusty Russell; +Cc: Linus Torvalds, linux-kernel, Rafael J. Wysocki
On Mon, Nov 17, 2008 at 08:22:18AM +1030, Rusty Russell wrote:
> Bug #11989: Suspend failure on NForce4-based boards due to chanes in stop_machine
>
> We should not access active.fnret outside the lock; in theory the next
> stop_machine could overwrite it.
>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> Tested-by: "Rafael J. Wysocki" <rjw@sisk.pl>
> ---
> kernel/stop_machine.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Thank you, Rusty, for finding and fixing this one as well!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-17 9:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-16 21:52 [PATCH] stop_machine: fix race with return value (fixes Bug #11989) Rusty Russell
2008-11-17 9:46 ` Heiko Carstens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox