scsi: libiscsi: Reject a negative task index from parse_pdu_itt
Impact
In the Linux kernel, the following vulnerability has been resolved:
Source excerpt · LinuxAffected packages
Affected products
Vendor version evidence. Product records are separate from automatic dependency matching.
Linux · Linux
Other versions: unaffected
| Version / range | Source status |
|---|---|
| bfead3b2cb4607c71831423c3ee97d22cd0c9dcb to before 6cadfa6f1f5896632d4223d3b7addb2a29fea74e | affected |
| bfead3b2cb4607c71831423c3ee97d22cd0c9dcb to before 35b60549a956237488c89a2d85352e026e7d55b7 | affected |
| bfead3b2cb4607c71831423c3ee97d22cd0c9dcb to before 8ee2a09a1dbb257c9e828ad2497f8e4832dfb142 | affected |
Linux · Linux
Other versions: affected
| Version / range | Source status |
|---|---|
| 2.6.33 | affected |
| 0 to before 2.6.33 | unaffected |
| 6.18.59 through 6.18.* (inclusive) | unaffected |
| 7.2.13 through 7.2.* (inclusive) | unaffected |
| 7.3 through * (inclusive) | unaffected |
Original source description
In the Linux kernel, the following vulnerability has been resolved:
scsi: libiscsi: Reject a negative task index from parse_pdu_itt
A transport that implements parse_pdu_itt hands libiscsi an index taken from the PDU, and both lookups bound it from above only:
if (i >= session->cmds_max)
i and cmds_max are both int, so a negative index passes and session->cmds[i] is read from before the array.
be2iscsi produces one. beiscsi_parse_pdu() assigns the raw tag,
*index = (int)itt;
and beiscsi_complete_pdu() forwards an unsolicited NOP-In from the hardware async ring without replacing its ITT, so the value is the target's. It also reports the session's own age rather than the one in the tag, which leaves the age comparison in iscsi_verify_itt() with nothing to reject.
Bound the index from below in both lookups.