CVE-2026-139112 PUBLISHED

rnbd-srv: publish the sess_dev at the end of OPEN

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

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

rnbd-srv: publish the sess_dev at the end of OPEN

rnbd_sess_dev_alloc() stores the empty sess_dev in the XArray as its first step. An IO message with the new ID from another connection can find it before bdev_file is set, or hold a reference while a failing OPEN frees it after a mere RCU grace period. Both are reachable from any host that can open a device.

Reserve the ID with a NULL entry and store the sess_dev once nothing can fail anymore. The error path still erases the ID, and no longer needs synchronize_rcu().

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 client's own RNBD_MSG_OPEN and an RNBD_MSG_IO carrying the new device_id arrive via rtrs_srv_rdma_done() -> process_io_req() -> rnbd_srv_rdma_ev() -> process_msg_open()/process_rdma(). rtrs_srv_rdma_init() listens with RDMA_PS_TCP on IN6ADDR_ANY, so RoCEv2/iWARP peers reach it over routable IP. AC:L - Each RTRS connection has its own IB_POLL_WORKQUEUE CQ, so an IO on a second connection runs rnbd_get_sess_dev() without srv_sess->lock while OPEN holds it, and xa_alloc() IDs are predictable. The peer forces free_srv_sess_dev itself: "ram0" then "./ram0" gives -EEXIST up to 5.10.y, and opening a device while its own last mapping closes on another session makes rnbd_srv_create_dev_sysfs() fail. Misses are harmless. PR:N - rtrs_rdma_connect() and process_info_req() check only RTRS_MAGIC, the version, cid/con_num and a unique pathname, and process_msg_open() checks only path length and "..". No credential is exchanged before a peer opens a device under dev_search_path and sends IO to its ID. UI:N - The OPEN, CLOSE and IO messages are handled by the server's CQ workqueue as ordinary RTRS traffic. The attacker supplies every step, and no administrator or local user does anything. S:U - The freed rnbd_srv_sess_dev, and the refcount and completion pointer touched through it, belong to the storage server's own kernel. No VM, IOMMU or sandbox boundary is crossed. C:H - free_srv_sess_dev waits only an RCU grace period before kfree(), while process_rdma() already holds a kref on the kmalloc-512 sess_dev. When its bio completes, rnbd_dev_bi_end_io() runs kref_put() on the freed slot and, at zero, complete() follows a destroy_comp pointer loaded from whatever reclaimed it, which can be groomed into a kernel read. I:H - The stale kref_put() decrements a refcount in reclaimed memory. If the next OPEN's sess_dev reuses the ID and slot, that live mapping is released early, and complete() through a reclaimed pointer writes via its wait-queue lock and done count: heap corruption exploitable for control flow. A:H - Without grooming, an IO landing between kref_init() and the bdev_file store in rnbd_srv_create_set_sess_dev() makes process_rdma() call file_bdev(NULL) and oops the CQ worker. On the UAF path, a reused slot oopses in complete(NULL). The unauthenticated peer can repeat both.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 2de6c8de192b9341ffa5e84afe1ce6196d4eef41 to 09a61095f582500ccface75a664bae226522ad74 (excl.)
  • affected from 2de6c8de192b9341ffa5e84afe1ce6196d4eef41 to 273408c3a7a5c16442b0fe902a8e88044a112553 (excl.)
  • affected from 2de6c8de192b9341ffa5e84afe1ce6196d4eef41 to 310b79760a901d6aff2f968b8de41de29e75d58c (excl.)
  • affected from 2de6c8de192b9341ffa5e84afe1ce6196d4eef41 to ffddd6e86a926a201af6ae903af6847cbe1e8ebd (excl.)
  • affected from 2de6c8de192b9341ffa5e84afe1ce6196d4eef41 to 53651d26368168f2b9971cf7136510c9af803777 (excl.)
  • affected from 2de6c8de192b9341ffa5e84afe1ce6196d4eef41 to 0fcec36fc1a28ebb29a524088e472605ca224840 (excl.)
  • affected from 2de6c8de192b9341ffa5e84afe1ce6196d4eef41 to 08ebf69c78a02afb39b7728f3358c09bc4cf067d (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 5.8 is affected
  • unaffected from 0 to 5.8 (excl.)
  • 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.119 to 6.12.* (incl.)
  • unaffected from 6.18.65 to 6.18.* (incl.)
  • unaffected from 7.3.6 to 7.3.* (incl.)
  • unaffected from 7.4-rc1 to * (incl.)

References