diff options
| author | Pavankumar Kondeti <pavan.kondeti@oss.qualcomm.com> | 2026-09-28 09:25:46 +0530 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-10-07 07:57:17 -1000 |
| commit | d1a4549a3645e55cc9ade09e360280590b3c9559 (patch) | |
| tree | 71d62be9ed726f51fd77908048a5a65aa981308f /include/uapi/linux/netdev.h | |
| parent | 7b63ef2d55f24519e7e9e5f4d15dbea03f126e40 (diff) | |
| download | linux-next-d1a4549a3645e55cc9ade09e360280590b3c9559.tar.gz linux-next-d1a4549a3645e55cc9ade09e360280590b3c9559.zip | |
workqueue: Fix NULL current_pwq deref in mem-reclaim helper
current_is_workqueue_mem_reclaim() uses current_wq_worker() to decide
whether %current is a workqueue worker and then checks the current
workqueue flags. However, current_wq_worker() only implies that %current
is a kworker; it does not imply that the worker is currently executing a
work item.
worker->current_pwq is set while process_one_work() runs the work
function and cleared afterwards. A kworker outside work-item execution can
therefore have PF_WQ_WORKER set with current_pwq cleared.
Guard the flag check with worker->current_pwq. Without a current_pwq, the
worker is not executing on a WQ_MEM_RECLAIM workqueue, so the helper
should return false.
Fixes: da729ddd4a1b ("NFS/localio: issue IO inline when not in a memory-reclaim context")
Signed-off-by: Pavankumar Kondeti <pavan.kondeti@oss.qualcomm.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/uapi/linux/netdev.h')
0 files changed, 0 insertions, 0 deletions
