diff options
author | Zheng Wang <[email protected]> | 2023-03-10 16:40:07 +0800 |
---|---|---|
committer | Guenter Roeck <[email protected]> | 2023-03-12 11:13:25 -0700 |
commit | cb090e64cf25602b9adaf32d5dfc9c8bec493cd1 (patch) | |
tree | ed7617f114d00d6be710a8dc48296a885208aa2e /drivers/usb/cdns3/cdns3-debug.h | |
parent | 48e8186870d9d0902e712d601ccb7098cb220688 (diff) |
hwmon: (xgene) Fix use after free bug in xgene_hwmon_remove due to race condition
In xgene_hwmon_probe, &ctx->workq is bound with xgene_hwmon_evt_work.
Then it will be started.
If we remove the driver which will call xgene_hwmon_remove to clean up,
there may be unfinished work.
The possible sequence is as follows:
Fix it by finishing the work before cleanup in xgene_hwmon_remove.
CPU0 CPU1
|xgene_hwmon_evt_work
xgene_hwmon_remove |
kfifo_free(&ctx->async_msg_fifo);|
|
|kfifo_out_spinlocked
|//use &ctx->async_msg_fifo
Fixes: 2ca492e22cb7 ("hwmon: (xgene) Fix crash when alarm occurs before driver probe")
Signed-off-by: Zheng Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-debug.h')
0 files changed, 0 insertions, 0 deletions