scsi: bsg: Fix TOCTOU in io_uring passthrough command setup
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: bsg: Fix TOCTOU in io_uring passthrough command setup
scsi_bsg_uring_cmd() reads bsg_uring_cmd from the shared mmap'd SQE. Userspace can change a field after we check it and before we use it. request_len is the sharp case: it can grow past sizeof(scmd->cmnd) after the bound check and overflow scmd->cmnd in copy_from_user().
READ_ONCE() the SQE fields we check or use into locals before use.
From the CVE record · Linux
The Linux kernel's SCSI bsg io_uring command setup reads fields from a shared memory-mapped submission entry that userspace can change after they are checked. A local userspace process can increase request_len after its bounds check, causing a buffer overflow when the command is copied; no separate user interaction is described.
Engineers running Linux kernels with SCSI bsg io_uring passthrough should check whether their kernel includes the fix; affected versions were not specified.