scsi: libiscsi: Fix stale-data leak into the SCSI sense buffer
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 7996a778ff8c717cb1a7a294475c59cc8f1e9fb8 · < 3ef209ca0b4b68c75e9a814d90cc916026b5a6ac| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: libiscsi: Fix stale-data leak into the SCSI sense buffer
iscsi_scsi_cmd_rsp() copies the sense data of a SCSI Response from the target-supplied data segment. The segment carries a 2-byte sense length followed by the sense bytes, so it must hold 2 + senselen bytes, but the bounds check only requires datalen >= senselen:
senselen = get_unaligned_be16(data); if (datalen < senselen) goto invalid_datalen; memcpy(sc->sense_buffer, data + 2, min_t(uint16_t, senselen, SCSI_SENSE_BUFFERSIZE));
A target that returns a SCSI Response whose datalen equals senselen (with senselen <= SCSI_SENSE_BUFFERSIZE) makes the memcpy() from data + 2 read up to two bytes past the received data. Those bytes are stale conn->data contents and end up in the command's sense buffer, which is returned to userspace.
Account for the 2-byte sense length prefix in the check.
From the CVE record · Linux
The Linux kernel's libiscsi code does not fully check the length of sense data in a SCSI Response. A target that sends a specially sized response can cause stale connection data to be copied into a command's sense buffer and returned to userspace. The input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels that use libiscsi should check their kernel versions against the vendor advisory; affected versions are not specified.