From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753775AbdKFUIH (ORCPT ); Mon, 6 Nov 2017 15:08:07 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:43543 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752322AbdKFUIG (ORCPT ); Mon, 6 Nov 2017 15:08:06 -0500 X-Google-Smtp-Source: ABhQp+RqN1fhEKCS/yvZSh10wYfIZf7K9RvGrgFuDsbvpVyjHafNAzJTf78dAxr7PRlFJO4kT5gQrw== Date: Mon, 6 Nov 2017 12:08:02 -0800 From: Tejun Heo To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Li Bin Subject: [GIT PULL] workqueue fix for v4.14-rc8 Message-ID: <20171106200802.GG3252168@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 #include +#include 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; }