nvme-tcp: reject a read that transferred too few bytes
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 5.15.221, 6.1.188, 6.6.157, 6.12.109, 6.18.50, and 1 more
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: none
- Automatable: yes
- Technical impact: partial
Summary
In the Linux kernel, the following vulnerability has been resolved: nvme-tcp: reject a read that transferred too few bytes nvme_tcp_recv_data() completes a request once the current C2HData PDU has been consumed. Nothing compares the total bytes received against the length the command asked for: struct nvme_tcp_request has no receive-side counter, queue->data_remaining is per queue, and blk_mq_end_request() completes for blk_rq_bytes(rq) unconditionally with no residual concept anywhere above. A controller can therefore answer a 4096-byte read with 512 bytes and have it reported as a complete read; user space then gets 4096 bytes of which 3584 are whatever was already in the page. I reproduced that with a test target. Count the bytes received and refuse to complete a successful read whose count does not match, at the two NVME_TCP_F_DATA_SUCCESS paths and in nvme_tcp_process_nvme_cqe(). The success test shifts req->status right by one, because the driver keeps the wire value there and shifts it on completion, so the check must see what the completion path will see. Only REQ_OP_READ is checked, because there the length comes from the sectors the request covers; a passthrough command is built by its submitter, which picks both command and buffer, so the kernel has nothing to compare against.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: none · Automatable: yes · Technical impact: partial
- Record last updated
Affected versions
- Linux Linux
From 3f2304f8c6d6ed97849057bd16fee99e434ca796 · fixed in a5c1bb0fb1bab2f24a081339c145870697f6d220; From 3f2304f8c6d6ed97849057bd16fee99e434ca796 · fixed in aa107e3a68f4af177d60f2d87679e7f67179a36c; From 3f2304f8c6d6ed97849057bd16fee99e434ca796 · fixed in fca3ebb63e5c82561cd9934365dcc0d068008006; From 3f2304f8c6d6ed97849057bd16fee99e434ca796 · fixed in 99066cf9bba175f610ceb61a35f6fc9fbc33ff65; From 3f2304f8c6d6ed97849057bd16fee99e434ca796 · fixed in 8a02ad98798fd01f51f648c1fdd8f3c9d07195d3; From 3f2304f8c6d6ed97849057bd16fee99e434ca796 · fixed in 832a685efeb5d925ee7d30011d2dbe45f81447a3; From 3f2304f8c6d6ed97849057bd16fee99e434ca796 · fixed in 7fa3f73f6c8ddc5f0425b50fb2a626a782ef7d12
- Linux Linux
5.0
- KernelLinux
From 5.0.0 · fixed in 5.15.221; From 5.16.0 · fixed in 6.1.188; From 6.2.0 · fixed in 6.6.157; From 6.7.0 · fixed in 6.12.109; From 6.13.0 · fixed in 6.18.50; From 6.19.0 · fixed in 7.2.4
References 7
git.kernel.org
- stable/c/a5c1bb0fb1bab2f24a081339c145870697f6d220
- stable/c/aa107e3a68f4af177d60f2d87679e7f67179a36c
- stable/c/fca3ebb63e5c82561cd9934365dcc0d068008006
- stable/c/99066cf9bba175f610ceb61a35f6fc9fbc33ff65
- stable/c/8a02ad98798fd01f51f648c1fdd8f3c9d07195d3
- stable/c/832a685efeb5d925ee7d30011d2dbe45f81447a3
- stable/c/7fa3f73f6c8ddc5f0425b50fb2a626a782ef7d12