{"id":"CVE-2026-143302","state":"PUBLISHED","title":"vhost-scsi: do not count PI bytes in the data length","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nvhost-scsi: do not count PI bytes in the data length\n\nvhost_scsi_handle_vq() moves pi_bytesout or pi_bytesin into the\nprotection sgl and subtracts those bytes from exp_data_len.  The length\npassed to TCM is still exp_data_len + prot_bytes.\n\nprot_bytes comes from virtio_scsi_cmd_req_pi.  With\nVIRTIO_SCSI_F_T10_PI negotiated, vhost reads that header and does not\ncheck that the CDB is a READ or WRITE.  sbc_check_prot() replaces\ndata_length from the CDB only when the protect field is non-zero.\ntarget_cmd_size_check() leaves a write's data_length unchanged when the\nCDB size is smaller, so a command that does not get that replacement\nkeeps a data_length larger than the data sgl.\n\nThe KASAN report is a MODE SELECT whose header had pi_bytesout set.\nThe data sgl held only the parameter list.  spc_emulate_modeselect()\nwalked data_length and read the next physical page.\n\nPass the data sgl length.  Protected READ and WRITE still take their\nlength from the CDB in sbc_check_prot().\n\nKASAN reports:\n\n  BUG: KASAN: use-after-free in spc_emulate_modeselect+0x145/0x380 [target_core_mod]\n  Read of size 1\n\n  spc_emulate_modeselect\n  __target_execute_cmd\n  target_execute_cmd\n  vhost_scsi_write_pending\n  transport_generic_new_cmd\n  __target_submit\n  target_queued_submit_work\n  process_one_work\n  worker_thread\n  kthread\n  ret_from_fork\n  ret_from_fork_asm","publishedAt":"2026-12-03T09:21:33.702Z","updatedAt":"2026-12-03T09:21:33.702Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"9f977ef7b671f6169eca78bf40f230fe84b7c7e5","status":"affected","lessThan":"54d08cd013c1777bccb43c1c27a81c51f39b3ef5","versionType":"git"},{"version":"9f977ef7b671f6169eca78bf40f230fe84b7c7e5","status":"affected","lessThan":"c4e6a85413f76a2152679567c59aef5168ea9d09","versionType":"git"},{"version":"9f977ef7b671f6169eca78bf40f230fe84b7c7e5","status":"affected","lessThan":"1f5bc40e33d8b3e5e3b89047956099b0c19f1d3d","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/vhost/scsi.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.16","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/vhost/scsi.c"]}],"references":["https://git.kernel.org/stable/c/54d08cd013c1777bccb43c1c27a81c51f39b3ef5","https://git.kernel.org/stable/c/c4e6a85413f76a2152679567c59aef5168ea9d09","https://git.kernel.org/stable/c/1f5bc40e33d8b3e5e3b89047956099b0c19f1d3d"],"weaknesses":[],"ingestedAt":"2026-12-03T09:42:04.348Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143302.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143302","state":"PUBLISHED","datePublished":"2026-12-03T09:21:33.702Z","dateUpdated":"2026-12-03T09:21:33.702Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.365Z"},"containers":{"cna":{"title":"vhost-scsi: do not count PI bytes in the data length","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nvhost-scsi: do not count PI bytes in the data length\n\nvhost_scsi_handle_vq() moves pi_bytesout or pi_bytesin into the\nprotection sgl and subtracts those bytes from exp_data_len.  The length\npassed to TCM is still exp_data_len + prot_bytes.\n\nprot_bytes comes from virtio_scsi_cmd_req_pi.  With\nVIRTIO_SCSI_F_T10_PI negotiated, vhost reads that header and does not\ncheck that the CDB is a READ or WRITE.  sbc_check_prot() replaces\ndata_length from the CDB only when the protect field is non-zero.\ntarget_cmd_size_check() leaves a write's data_length unchanged when the\nCDB size is smaller, so a command that does not get that replacement\nkeeps a data_length larger than the data sgl.\n\nThe KASAN report is a MODE SELECT whose header had pi_bytesout set.\nThe data sgl held only the parameter list.  spc_emulate_modeselect()\nwalked data_length and read the next physical page.\n\nPass the data sgl length.  Protected READ and WRITE still take their\nlength from the CDB in sbc_check_prot().\n\nKASAN reports:\n\n  BUG: KASAN: use-after-free in spc_emulate_modeselect+0x145/0x380 [target_core_mod]\n  Read of size 1\n\n  spc_emulate_modeselect\n  __target_execute_cmd\n  target_execute_cmd\n  vhost_scsi_write_pending\n  transport_generic_new_cmd\n  __target_submit\n  target_queued_submit_work\n  process_one_work\n  worker_thread\n  kthread\n  ret_from_fork\n  ret_from_fork_asm"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"9f977ef7b671f6169eca78bf40f230fe84b7c7e5","status":"affected","lessThan":"54d08cd013c1777bccb43c1c27a81c51f39b3ef5","versionType":"git"},{"version":"9f977ef7b671f6169eca78bf40f230fe84b7c7e5","status":"affected","lessThan":"c4e6a85413f76a2152679567c59aef5168ea9d09","versionType":"git"},{"version":"9f977ef7b671f6169eca78bf40f230fe84b7c7e5","status":"affected","lessThan":"1f5bc40e33d8b3e5e3b89047956099b0c19f1d3d","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/vhost/scsi.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.16","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/vhost/scsi.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/54d08cd013c1777bccb43c1c27a81c51f39b3ef5"},{"url":"https://git.kernel.org/stable/c/c4e6a85413f76a2152679567c59aef5168ea9d09"},{"url":"https://git.kernel.org/stable/c/1f5bc40e33d8b3e5e3b89047956099b0c19f1d3d"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:21:33.702Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.16","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.16","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.16","versionEndExcluding":"7.4-rc2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}