scsi: target: file: Use kzalloc_flex for aio_cmd
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 |
|
|
6.18.226.19.127.0In the Linux kernel, the following vulnerability has been resolved:
scsi: target: file: Use kzalloc_flex for aio_cmd
The target_core_file doesn't initialize the aio_cmd->iocb for the ki_write_stream. When a write command fd_execute_rw_aio() is executed, we may get a bogus ki_write_stream value, causing unintended write failure status when checking iocb->ki_write_stream > max_write_streams in the block device.
Let's just use kzalloc_flex when allocating the aio_cmd and let ki_write_stream=0 to fix this issue.
From the CVE record · Linux
The Linux kernel's SCSI target file component does not initialize a field in aio_cmd. When an asynchronous write command runs, a bogus value can cause the write to fail. The input does not specify an attacker access requirement or user interaction.
Engineers running Linux kernels that use the SCSI target file component should check their installations; affected versions are not specified.