Commit 607836f
committed
nvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu()
jira VULN-56024
cve CVE-2025-21927
commit-author Maurizio Lombardi <mlombard@redhat.com>
commit ad95bab
upstream-diff Removed `nvme_tcp_c2h_term' case from
`nvme_tcp_recv_pdu_supported' for the sake of consistency of
`nvme_tcp_recv_pdu''s behavior relative to the upstream
version, between the cases of proper and improper
header. (What could be considered as "`c2h_term' type support"
started with 84e0090 commit,
not included in `ciqlts8_8''s history, so
`nvme_tcp_recv_pdu_supported' in `ciqlts8_8' shouldn't report
the `nvme_tcp_c2h_term' type as supported.)
nvme_tcp_recv_pdu() doesn't check the validity of the header length.
When header digests are enabled, a target might send a packet with an
invalid header length (e.g. 255), causing nvme_tcp_verify_hdgst()
to access memory outside the allocated area and cause memory corruptions
by overwriting it with the calculated digest.
Fix this by rejecting packets with an unexpected header length.
Fixes: 3f2304f ("nvme-tcp: add NVMe over TCP host driver")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
(cherry picked from commit ad95bab)
Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>1 parent f10433c commit 607836f
1 file changed
+28
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
156 | 168 | | |
157 | 169 | | |
158 | 170 | | |
| |||
675 | 687 | | |
676 | 688 | | |
677 | 689 | | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
678 | 700 | | |
679 | 701 | | |
680 | 702 | | |
| |||
698 | 720 | | |
699 | 721 | | |
700 | 722 | | |
701 | | - | |
702 | | - | |
703 | | - | |
| 723 | + | |
704 | 724 | | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
705 | 730 | | |
706 | 731 | | |
707 | 732 | | |
| |||
0 commit comments