mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-01 23:53:16 -04:00
workqueue: Add a new flag to spot the potential UAF error
Currently if the user queues a new work item unintentionally into a wq after the destroy_workqueue(wq), the work still can be queued and scheduled without any noticeable kernel message before the end of a RCU grace period. As a debug-aid facility, this commit adds a new flag __WQ_DESTROYING to spot that issue by triggering a kernel WARN message. Signed-off-by: Richard Clark <richard.xnu.clark@gmail.com> Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
512dee0c00
commit
33e3f0a335
2 changed files with 13 additions and 3 deletions
|
@ -335,6 +335,7 @@ enum {
|
|||
*/
|
||||
WQ_POWER_EFFICIENT = 1 << 7,
|
||||
|
||||
__WQ_DESTROYING = 1 << 15, /* internal: workqueue is destroying */
|
||||
__WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */
|
||||
__WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */
|
||||
__WQ_LEGACY = 1 << 18, /* internal: create*_workqueue() */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue