scsi: sd: Fix special_vec mempool leak when scsi_alloc_sgtables() fails
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 81d926e8b5520e38f1f72dd7bb7cfc81c1a69d87 · < bb31844d88b77138b67aa20c3600203baff40140| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: sd: Fix special_vec mempool leak when scsi_alloc_sgtables() fails
sd_set_special_bvec() allocates a special payload page for UNMAP and WRITE SAME commands. If scsi_alloc_sgtables() fails afterward in sd_setup_unmap_cmnd() or sd_setup_write_same{10,16}_cmnd(), the SCSI midlayer does not call uninit_command() because RQF_DONTPREP is not set yet, leaking the page.
Call sd_uninit_command() on error, and clear RQF_SPECIAL_PAYLOAD after freeing the page.
From the CVE record · Linux
The Linux kernel’s SCSI sd driver can leak a special payload page if SCSI table allocation fails while preparing an UNMAP or WRITE SAME command. The input does not describe an attacker path, authentication requirements, or user interaction.
Operators running Linux kernels with the affected SCSI sd code should check their kernel version; affected versions are not specified.