All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: [PATCH] stop_machine: fix race with return value (fixes Bug #11989)
Date: Mon, 17 Nov 2008 08:22:18 +1030	[thread overview]
Message-ID: <200811170822.18880.rusty@rustcorp.com.au> (raw)

[-- 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¥

             reply	other threads:[~2008-11-16 21:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-16 21:52 Rusty Russell [this message]
2008-11-17  9:46 ` [PATCH] stop_machine: fix race with return value (fixes Bug #11989) Heiko Carstens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200811170822.18880.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.