Skip to content
Commit 197f6acc authored by Tejun Heo's avatar Tejun Heo
Browse files

workqueue: Make sure struct worker is accessible for wq_worker_comm()



The worker struct could already be freed when wq_worker_comm() tries
to access it for reporting.  This patch protects PF_WQ_WORKER
modifications with wq_pool_attach_mutex and makes wq_worker_comm()
test the flag before dereferencing worker from kthread_data(), which
ensures that it only dereferences when the worker struct is valid.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Reported-by: default avatarLai Jiangshan <jiangshanlai@gmail.com>
Fixes: 6b59808b ("workqueue: Show the latest workqueue name in /proc/PID/{comm,stat,status}")
parent 6b59808b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment