CVE-2026-23112: nvmet-tcp: add bounds checks in nvmet_tcp_build_pdu_iovec
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
nvmet-tcp: add bounds checks in nvmet_tcp_build_pdu_iovec
nvmet_tcp_build_pdu_iovec() could walk past cmd->req.sg when a PDU length or offset exceeds sg_cnt and then use bogus sg->length/offset values, leading to _copy_to_iter() GPF/KASAN. Guard sg_idx, remaining entries, and sg->length/offset before building the bvec.
The Linux kernel CVE team has assigned CVE-2026-23112 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.0 with commit 872d26a391da92ed8f0c0f5cb5fef428067b7f30 and fixed in 5.10.250 with commit 043b4307a99f902697349128fde93b2ddde4686c Issue introduced in 5.0 with commit 872d26a391da92ed8f0c0f5cb5fef428067b7f30 and fixed in 5.15.200 with commit 42afe8ed8ad2de9c19457156244ef3e1eca94b5d Issue introduced in 5.0 with commit 872d26a391da92ed8f0c0f5cb5fef428067b7f30 and fixed in 6.1.163 with commit 1385be357e8acd09b36e026567f3a9d5c61139de Issue introduced in 5.0 with commit 872d26a391da92ed8f0c0f5cb5fef428067b7f30 and fixed in 6.6.124 with commit dca1a6ba0da9f472ef040525fab10fd9956db59f Issue introduced in 5.0 with commit 872d26a391da92ed8f0c0f5cb5fef428067b7f30 and fixed in 6.12.70 with commit 19672ae68d52ff75347ebe2420dde1b07adca09f Issue introduced in 5.0 with commit 872d26a391da92ed8f0c0f5cb5fef428067b7f30 and fixed in 6.18.10 with commit ab200d71553bdcf4de554a5985b05b2dd606bc57 Issue introduced in 5.0 with commit 872d26a391da92ed8f0c0f5cb5fef428067b7f30 and fixed in 6.19 with commit 52a0a98549344ca20ad81a4176d68d28e3c05a5c
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-23112
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/nvme/target/tcp.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/043b4307a99f902697349128fde93b2ddde4686c https://git.kernel.org/stable/c/42afe8ed8ad2de9c19457156244ef3e1eca94b5d https://git.kernel.org/stable/c/1385be357e8acd09b36e026567f3a9d5c61139de https://git.kernel.org/stable/c/dca1a6ba0da9f472ef040525fab10fd9956db59f https://git.kernel.org/stable/c/19672ae68d52ff75347ebe2420dde1b07adca09f https://git.kernel.org/stable/c/ab200d71553bdcf4de554a5985b05b2dd606bc57 https://git.kernel.org/stable/c/52a0a98549344ca20ad81a4176d68d28e3c05a5c