HIGH
nvme-tcp H2C_DATA NULL Deref
CVE-2026-22998
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
KernelScan AI7.5HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: nvme-tcp: fix NULL pointer dereferences in nvmet_tcp_build_pdu_iovec Commit efa56305908b ("nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length") added ttag bounds checking and data_offset validation in nvmet_tcp_handle_h2c_data_pdu(), but it did not validate whether the command's data structures (cmd->req.sg and cmd->iov) have been properly initialized before processing H2C_DATA PDUs. The nvmet_tcp_build_pdu_iovec() function dereferences these pointers without NULL checks. This can be triggered by sending H2C_DATA PDU immediately after the ICREQ/ICRESP handshake, before sending a CONNECT command or NVMe write command. Attack vectors that trigger NULL pointer dereferences: 1. H2C_DATA PDU sent before CONNECT → both pointers NULL 2. H2C_DATA PDU for READ command → cmd->req.sg allocated, cmd->iov NULL 3. H2C_DATA PDU for uninitialized command slot → both pointers NULL The fix validates both cmd->req.sg and cmd->iov before calling nvmet_tcp_build_pdu_iovec(). Both checks are required because: - Uninitialized commands: both NULL - READ commands: cmd->req.sg allocated, cmd->iov NULL - WRITE commands: both allocated
02KernelScan AI Analysis
Risk summary
A remote attacker can crash NVMe-over-TCP target systems by sending malformed protocol data units during the connection handshake, causing denial of service through kernel NULL pointer dereferences. This affects storage infrastructure using NVMe-over-TCP.
Vulnerability analysis
Root Cause: The nvmet_tcp_handle_h2c_data_pdu() function processes H2C_DATA PDUs without validating that the command's data structures (cmd->req.sg and cmd->iov) have been properly initialized. The nvmet_tcp_build_pdu_iovec() function then dereferences these pointers without NULL checks, leading to kernel crashes when malformed PDUs are sent at inappropriate times in the protocol handshake.
Attack Surface: Network-accessible NVMe-over-TCP target implementations. An attacker can trigger this vulnerability by sending specially crafted H2C_DATA PDUs at specific points in the protocol handshake (before CONNECT commands, for READ commands, or for uninitialized command slots) over TCP connections to NVMe target services.
Fix Mechanism: The patch adds validation checks for both cmd->req.sg and cmd->iov pointers before calling nvmet_tcp_build_pdu_iovec(). If either pointer is NULL, the function logs an error and returns a protocol error instead of attempting to dereference the NULL pointers. Both checks are necessary because different command states can have different NULL pointer combinations.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 5.10 | 5.10.249 | baabe43a0ede |
| 5.15 | 5.15.199 | 76abc83a9d25 |
| 5.5 | 5.5 | 3def52431507 |
| 6.1 | 6.1.162 | 7d7557000292 |
| 6.12 | 6.12.67 | 32b63acd78f5 |
| 6.18 | 6.18.7 | — |
| 6.6 | 6.6.122 | fdecd3b6aac1 |
| 6.8 | 6.8 | 374b095e265f |
| mainline | 6.19 | — |