CVE-2026-138816 PUBLISHED

nvme-rdma: don't complete a request after a bogus remote invalidation

Assigner: Linux
Reserved: 30.11.2026 Published: 30.11.2026 Updated: 01.12.2026

In the Linux kernel, the following vulnerability has been resolved:

nvme-rdma: don't complete a request after a bogus remote invalidation

When a remote invalidation names an rkey that is not the one we handed out for this request, nvme_rdma_process_nvme_rsp() logs and schedules error recovery, then falls through to nvme_rdma_end_request(). The request is completed with req->mr never invalidated, and nvme_rdma_unmap_data() hands it back with ib_mr_pool_put(), which only puts it on a list. The rkey stays valid and still maps the pages the completed read filled, so a controller that sent the bogus invalidation can write into those pages after pread() has returned.

Return instead, the way the local invalidation path below already does, and leave the request for error recovery to cancel.

Metrics

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

AV:N - The bad rkey arrives in the IETH of the target's RDMA SEND_WITH_INV carrying the NVMe completion. nvme_rdma_recv_done passes wc->ex.invalidate_rkey to nvme_rdma_process_nvme_rsp, the patched function. The RC QP is set up by rdma_resolve_addr to an IP traddr, so over RoCEv2 or iWARP the target is IP-routable. AC:L - The target sets up the state itself. It keeps one data command outstanding so that rkey stays live (e.g. an ANA log read it triggers by AEN). It answers a second one (e.g. the AEN-triggered Changed NS log read) with SEND_WITH_INV naming the first rkey, then keeps issuing RDMA READ/WRITE to the second rkey until err_work reaches rdma_disconnect. It can repeat this after every reconnect. PR:N - nvme_rdma_process_nvme_rsp acts on a completion from the connected target and checks no host uid, capability or local account. The live rkeys the target names come from the keyed SGLs of the host's own commands, and all queues share ndev->pd. UI:N - The host kernel issues the I/O and the AEN-driven Get Log Page reads itself, with no user action. nvme_rdma_error_recovery then reconnects automatically, so the target can trigger the bug again without anyone acting. S:U - The stale MR exposes only the initiator kernel's own memory, through its own HCA and PD. The driver that fails to revoke the rkey and the memory reached through it are both under the same host kernel authority. C:H - nvme_rdma_map_sg_fr registers the MR with IB_ACCESS_REMOTE_READ. Pre-fix, nvme_rdma_unmap_data only ib_mr_pool_put()s it, so the target can RDMA READ pages the host has released, e.g. the buffer nvme_clear_changed_ns_log kfree()s right after the Get Log Page completes. That reads whatever the allocator reuses it for, on hosts without a strict IOMMU (iommu=pt or x86 lazy flush). I:H - The same MR grants IB_ACCESS_REMOTE_WRITE. After pread() returns and any verifier has run, the target can still overwrite the completed read's page-cache or user pages. It can also write into freed kernel buffers such as the kfree'd changed-ns log: a remote DMA use-after-free write into reallocated kernel memory. A:H - Writes through the stale rkey into freed and reallocated kernel memory corrupt whatever kernel object now sits there and can crash the host. Each bogus invalidation also forces a controller reset that cancels all in-flight I/O.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 3ef0279bb0031f67537bd8972899a6a23d3064d7 to 05f7cbf026f76222512e8e8860390700cc9ae12f (excl.)
  • affected from 3ef0279bb0031f67537bd8972899a6a23d3064d7 to 61faf08159ba3926db91d2053f7667d539b0cbf1 (excl.)
  • affected from 3ef0279bb0031f67537bd8972899a6a23d3064d7 to fd797069f18c66c1b75743a93773028b55a8dad9 (excl.)
  • affected from 3ef0279bb0031f67537bd8972899a6a23d3064d7 to 0ca849f565874ff3638fb673aced5a4d208aaa67 (excl.)
  • affected from 3ef0279bb0031f67537bd8972899a6a23d3064d7 to 5c8032e3c7baa7820b524fda81dd5a683136a442 (excl.)
  • affected from 3ef0279bb0031f67537bd8972899a6a23d3064d7 to 5564d7a654a7be040d7dd55fd9dd20dd4e0beab2 (excl.)
  • affected from 3ef0279bb0031f67537bd8972899a6a23d3064d7 to 08e4d674c109f4a4002efdb1b3066430abe62404 (excl.)
  • affected from 3ef0279bb0031f67537bd8972899a6a23d3064d7 to 909307cea08aff4e486cdb7491de5c76a2c31341 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 4.15 is affected
  • unaffected from 0 to 4.15 (excl.)
  • unaffected from 5.10.275 to 5.10.* (incl.)
  • unaffected from 5.15.226 to 5.15.* (incl.)
  • unaffected from 6.1.193 to 6.1.* (incl.)
  • unaffected from 6.6.163 to 6.6.* (incl.)
  • unaffected from 6.12.117 to 6.12.* (incl.)
  • unaffected from 6.18.63 to 6.18.* (incl.)
  • unaffected from 7.3.4 to 7.3.* (incl.)
  • unaffected from 7.4-rc1 to * (incl.)

References