* Patch "net: pktgen: fix race between pktgen_thread_worker() and kthread_stop()" has been added to the 3.10-stable tree
@ 2015-09-26 19:21 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-09-26 19:21 UTC (permalink / raw)
To: oleg, davem, gregkh, jstancek, mleitner; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
net: pktgen: fix race between pktgen_thread_worker() and kthread_stop()
to the 3.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-pktgen-fix-race-between-pktgen_thread_worker-and-kthread_stop.patch
and it can be found in the queue-3.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From foo@baz Sat Sep 26 11:20:32 PDT 2015
From: Oleg Nesterov <oleg@redhat.com>
Date: Wed, 8 Jul 2015 21:42:11 +0200
Subject: net: pktgen: fix race between pktgen_thread_worker() and kthread_stop()
From: Oleg Nesterov <oleg@redhat.com>
[ Upstream commit fecdf8be2d91e04b0a9a4f79ff06499a36f5d14f ]
pktgen_thread_worker() is obviously racy, kthread_stop() can come
between the kthread_should_stop() check and set_current_state().
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reported-by: Jan Stancek <jstancek@redhat.com>
Reported-by: Marcelo Leitner <mleitner@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/pktgen.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3377,8 +3377,10 @@ static int pktgen_thread_worker(void *ar
pktgen_rem_thread(t);
/* Wait for kthread_stop */
- while (!kthread_should_stop()) {
+ for (;;) {
set_current_state(TASK_INTERRUPTIBLE);
+ if (kthread_should_stop())
+ break;
schedule();
}
__set_current_state(TASK_RUNNING);
Patches currently in stable-queue which might be from oleg@redhat.com are
queue-3.10/net-pktgen-fix-race-between-pktgen_thread_worker-and-kthread_stop.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-26 19:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26 19:21 Patch "net: pktgen: fix race between pktgen_thread_worker() and kthread_stop()" has been added to the 3.10-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).