Commit 326cfbf
nvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu()
jira VULN-56028
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 `ciqlts9_2''s history, so
`nvme_tcp_recv_pdu_supported' in `ciqlts9_2' 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 35c80df commit 326cfbf
1 file changed
+28
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
192 | 204 | | |
193 | 205 | | |
194 | 206 | | |
| |||
716 | 728 | | |
717 | 729 | | |
718 | 730 | | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
719 | 741 | | |
720 | 742 | | |
721 | 743 | | |
| |||
739 | 761 | | |
740 | 762 | | |
741 | 763 | | |
742 | | - | |
743 | | - | |
744 | | - | |
| 764 | + | |
745 | 765 | | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
746 | 771 | | |
747 | 772 | | |
748 | 773 | | |
| |||
0 commit comments