KernelScan.io

HIGH

nvme-tcp H2C_DATA NULL Deref

CVE-2026-22998

CVSS 7.5 / 10.0 NVD

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

KernelScan AI7.5HIGH

01

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

02

Engine v0.2.0

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.

Affecteddrivers/nvme/target/tcp.c

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.

03

BranchFixed inPatch commit
5.105.10.249baabe43a0ede
5.155.15.19976abc83a9d25
5.55.53def52431507
6.16.1.1627d7557000292
6.126.12.6732b63acd78f5
6.186.18.7
6.66.6.122fdecd3b6aac1
6.86.8374b095e265f
mainline6.19