summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorFan Wu <fanwu01@zju.edu.cn>2026-09-11 02:05:44 +0000
committerMartin K. Petersen (Oracle) <mkp@kernel.org>2026-09-25 22:17:49 -0400
commit0b1a79f2791a06f139dce5450e487307cf0e241f (patch)
tree2e983f723e23620dd725934bd17145303b67c6e9 /scripts/Makefile.thinlto
parentf09d2c7485b32adb82336d0d748935c8237a649e (diff)
downloadlinux-next-0b1a79f2791a06f139dce5450e487307cf0e241f.tar.gz
linux-next-0b1a79f2791a06f139dce5450e487307cf0e241f.zip
scsi: dc395x: sync the waiting_timer before freeing the host
The waiting_timer callback re-arms itself and takes the host lock. adapter_uninit() currently stops it with timer_delete(), which does not wait for a callback already running on another CPU. The final scsi_host_put() that frees the host (and the host lock the callback dereferences) runs right after adapter_uninit(), so a concurrent or just re-armed callback can fire after the free, leaving a potential use-after-free window. Replace timer_delete() with timer_shutdown_sync() at the top of adapter_uninit(), before the host-lock section: the timer is dequeued, a running callback is waited for and rearming is blocked before the chip is halted, so it cannot fire at all once the adapter has ceased to function. Waiting outside the lock avoids the self-deadlock that would result from syncing a callback blocked on the lock we still hold. No shutdown is needed for selto_timer because it has no reachable armer or callback. This issue was found by an in-house static analysis tool. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Cc: Jamie Lenehan <lenehan@twibble.org> Assisted-by: Codex:gpt-5.6 Signed-off-by: Fan Wu <fanwu01@zju.edu.cn> Link: https://patch.msgid.link/20260911020544.42966-1-fanwu01@zju.edu.cn Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions