From: Tejun Heo <tj@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Li Bin <huawei.libin@huawei.com>
Subject: [GIT PULL] workqueue fix for v4.14-rc8
Date: Mon, 6 Nov 2017 12:08:02 -0800 [thread overview]
Message-ID: <20171106200802.GG3252168@devbig577.frc2.facebook.com> (raw)
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;
}
reply other threads:[~2017-11-06 20:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20171106200802.GG3252168@devbig577.frc2.facebook.com \
--to=tj@kernel.org \
--cc=huawei.libin@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox