+34
−24
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
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:Tejun Heo <tj@kernel.org> Reported-by:
Lai Jiangshan <jiangshanlai@gmail.com> Fixes: 6b59808b ("workqueue: Show the latest workqueue name in /proc/PID/{comm,stat,status}")