scsi: qla2xxx: Fix cs84xx use-after-free on host teardown
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ fe1b806f4f7172b1eae18ddeebb7d8fb351043f7 · < 8286a9095fb59751fba171afa2b4f590271c87d5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: qla2xxx: Fix cs84xx use-after-free on host teardown
qla84xx_put_chip() drops the last reference to ha->cs84xx and frees it via __qla84xx_chip_release() without clearing ha->cs84xx. During teardown it ran before scsi_remove_host(), which is what removes the 84xx_fw_version host sysfs attribute. A concurrent read of that attribute in the window between the two calls executes qla24xx_84xx_fw_version_show(), which dereferences the freed ha->cs84xx, resulting in a use-after-free.
Move qla84xx_put_chip() to after scsi_remove_host() in both qla2x00_remove_one() and qla2x00_disable_board_on_pci_error(). Once scsi_remove_host() returns, the sysfs attribute is gone and kernfs has drained any in-flight show(), so no reader can touch cs84xx; the put still runs before the host and ha are freed.
From the CVE record · Linux
The Linux kernel's qla2xxx driver can free cs84xx data before removing the 84xx_fw_version sysfs attribute during host teardown. A concurrent local read of that attribute can dereference the freed data, causing a use-after-free. Authentication requirements are not specified; the read must coincide with teardown.
Engineers running Linux kernels with the qla2xxx driver should check their kernel version; affected versions are not specified in the input.