CVE-2026-98537: workqueue: Fix NULL current_pwq deref in flush dependency check
In the Linux kernel, the following vulnerability has been resolved:
workqueue: Fix NULL currentpwq deref in flush dependency check
checkflushdependency() uses currentwqworker() to determine whether the caller is a workqueue worker and then dereferences worker->currentpwq to test whether the current workqueue is WQMEMRECLAIM.
currentwqworker() only means that %current has PFWQWORKER set. A kworker can reach checkflushdependency() while it is not executing a work item. One such path is workerthread() acting as the pool manager, where createworker() does GFPKERNEL allocation and the allocation path invokes the OOM notifier. In that state worker->currentpwq is NULL because currentpwq is set only by processonework() and cleared again after the work function returns.
[ 416.760634][ T375] Call trace: [ 416.760638][ T375] checkflushdependency+0x80/0x120 (P) [ 416.760648][ T375] flushwork+0x98/0x224 [ 416.760657][ T375] flushwork+0x30/0x44 [ 416.760665][ T375] ... [ 416.760710][ T375] blockingnotifiercallchain+0x58/0xa0 [ 416.760719][ T375] outofmemory+0xb4/0x458 [ 416.760730][ T375] allocpagesmayoom+0x11c/0x1a8 [ 416.760739][ T375] allocpagesslowpath+0x314/0x46c [ 416.760746][ T375] allocfrozenpagesnoprof+0x110/0x1a4 [ 416.760753][ T375] newslab+0x12c/0x484 [ 416.760759][ T375] slaballoc+0x7a8/0xc7c [ 416.760765][ T375] slaballoc+0x74/0xd8 [ 416.760772][ T375] kmalloccachenodenoprof+0x2ac/0x304 [ 416.760779][ T375] allocworker+0x28/0x60 [ 416.760785][ T375] createworker+0x4c/0x20c [ 416.760790][ T375] workerthread+0xe8/0x2b8 [ 416.760796][ T375] kthread+0x1a8/0x200 [ 416.760805][ T375] retfromfork+0x10/0x20
Guard the WQMEMRECLAIM-worker warning with worker->currentpwq. If the kworker is not currently executing a work item, there is no current workqueue to diagnose with that warning. The PFMEMALLOC warning is left unchanged so explicit reclaim context flushing a !WQMEMRECLAIM target is still reported.