public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] workqueue fix for v4.14-rc8
@ 2017-11-06 20:08 Tejun Heo
  0 siblings, 0 replies; only message in thread
From: Tejun Heo @ 2017-11-06 20:08 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Li Bin

Hello, Linus.

Another fix for a really old bug.  It only affects drain_workqueue()
which isn't used often and even then triggers only during a pretty
small race window, so it isn't too surprising that it stayed hidden
for so long.  The fix is straight-forward and low-risk.  Kudos to Li
Bin for reporting and fixing the bug.

Thanks.

The following changes since commit 692b48258dda7c302e777d7d5f4217244478f1f6:

  workqueue: replace pool->manager_arb mutex with a flag (2017-10-10 07:13:57 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-4.14-fixes

for you to fetch changes up to cef572ad9bd7f85035ba8272e5352040e8be0152:

  workqueue: Fix NULL pointer dereference (2017-10-30 07:56:01 -0700)

----------------------------------------------------------------
Li Bin (1):
      workqueue: Fix NULL pointer dereference

 kernel/workqueue_internal.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h
index 8635417..29fa81f 100644
--- a/kernel/workqueue_internal.h
+++ b/kernel/workqueue_internal.h
@@ -9,6 +9,7 @@
 
 #include <linux/workqueue.h>
 #include <linux/kthread.h>
+#include <linux/preempt.h>
 
 struct worker_pool;
 
@@ -59,7 +60,7 @@ struct worker {
  */
 static inline struct worker *current_wq_worker(void)
 {
-	if (current->flags & PF_WQ_WORKER)
+	if (in_task() && (current->flags & PF_WQ_WORKER))
 		return kthread_data(current);
 	return NULL;
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-06 20:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-06 20:08 [GIT PULL] workqueue fix for v4.14-rc8 Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox