CVE-2026-143302: vhost-scsi: do not count PI bytes in the data length
In the Linux kernel, the following vulnerability has been resolved:
vhost-scsi: do not count PI bytes in the data length
vhostscsihandlevq() moves pibytesout or pibytesin into the protection sgl and subtracts those bytes from expdatalen. The length passed to TCM is still expdatalen + protbytes.
protbytes comes from virtioscsicmdreqpi. With VIRTIOSCSIFT10PI negotiated, vhost reads that header and does not check that the CDB is a READ or WRITE. sbccheckprot() replaces datalength from the CDB only when the protect field is non-zero. targetcmdsizecheck() leaves a write's datalength unchanged when the CDB size is smaller, so a command that does not get that replacement keeps a datalength larger than the data sgl.
The KASAN report is a MODE SELECT whose header had pibytesout set. The data sgl held only the parameter list. spcemulatemodeselect() walked datalength and read the next physical page.
Pass the data sgl length. Protected READ and WRITE still take their length from the CDB in sbccheckprot().
KASAN reports:
BUG: KASAN: use-after-free in spcemulatemodeselect+0x145/0x380 [targetcoremod] Read of size 1
spcemulatemodeselect targetexecutecmd targetexecutecmd vhostscsiwritepending transportgenericnewcmd targetsubmit targetqueuedsubmitwork processonework workerthread kthread retfromfork retfromforkasm
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7
Event History
Frequently Asked Questions
Which deployments are exposed?
The issue applies to Linux kernel deployments using vhost-scsi where the VIRTIO_SCSI_F_T10_PI feature is negotiated. The reported trigger involves a MODE SELECT command with pi_bytesout set.
What does an attacker need to do to trigger the flaw?
They need to submit a virtio SCSI request with T10 PI negotiated and PI byte counts set in a way that leaves the command data length larger than the actual data scatter-gather list. The vulnerable path does not verify that the CDB is a READ or WRITE before processing the PI header.
How might existing exploitation attempts appear?
KASAN can report a use-after-free read in spc_emulate_modeselect within target_core_mod. The example report is a byte-sized read while MODE SELECT processing walks beyond the parameter-list data into the next physical page.