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.
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.
| Attack Vector |
Network |
Scope |
Unchanged |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
None |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
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.
CVSS 3.1