]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: aic94xx: fix use-after-free in device removal path
authorJunrui Luo <moonafterrain@outlook.com>
Tue, 28 Oct 2025 16:29:04 +0000 (00:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:16 +0000 (12:57 +0100)
commit751c19635c2bfaaf2836a533caa3663633066dcf
tree698d679dcdd6bcdca84fe0026f9eaf44931fbf61
parent1c728951bc769b795d377852eae1abddad88635d
scsi: aic94xx: fix use-after-free in device removal path

commit f6ab594672d4cba08540919a4e6be2e202b60007 upstream.

The asd_pci_remove() function fails to synchronize with pending tasklets
before freeing the asd_ha structure, leading to a potential
use-after-free vulnerability.

When a device removal is triggered (via hot-unplug or module unload),
race condition can occur.

The fix adds tasklet_kill() before freeing the asd_ha structure,
ensuring all scheduled tasklets complete before cleanup proceeds.

Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Reported-by: Junrui Luo <moonafterrain@outlook.com>
Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver")
Cc: stable@vger.kernel.org
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/ME2PR01MB3156AB7DCACA206C845FC7E8AFFDA@ME2PR01MB3156.ausprd01.prod.outlook.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/aic94xx/aic94xx_init.c