CVE-2026-139115 PUBLISHED

block/rnbd-srv: don't free the device on a sysfs error

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

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

block/rnbd-srv: don't free the device on a sysfs error

rnbd_srv_create_dev_sysfs() drops the only kobject reference on its error paths, and the release function frees the rnbd_srv_dev. process_msg_open() keeps using it and ends in destroy_device() with a list_del() and a second kfree(). This doesn't need memory pressure: a client opening a device while its last mapping goes away gets -EEXIST from kobject_add() against the old directory.

Only undo kobject_add() on failure and leave the reference to destroy_device(). Initialise the kobject once, the next open retries.

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 trigger is RNBD_MSG_OPEN and RNBD_MSG_CLOSE messages sent by an RTRS client and handled by rnbd_srv_rdma_ev() -> process_msg_open() and process_msg_close(). RTRS listens on IN6ADDR_ANY in the RDMA_PS_TCP port space, which RoCEv2 and iWARP carry over routable IP, so a remote peer drives the faulty error path in rnbd_srv_create_dev_sysfs(). AC:L - The client controls both sides of the race. Session A's CLOSE drops the device's last kref while its sysfs directory still exists, and session B's OPEN for the same device makes find_or_add add a new srv_dev whose kobject_add() gets -EEXIST. The two sessions run concurrently on ib-comp-wq, and a lost race costs nothing, so the attacker can retry until it hits. No memory pressure is needed. PR:N - rtrs_rdma_connect() checks only magic, version and cid, with no authentication, and create_sess() accepts any sessname. process_msg_open() opens whatever dev_name the client sends under dev_search_path (default "/"), so an unauthenticated peer can create both sessions and the mappings. UI:N - The attacker's own sessions send the open and close messages that produce the race. No server administrator or other user has to do anything. S:U - The memory corrupted is in the rnbd-srv server kernel's own heap. No hypervisor, IOMMU or other security authority is crossed. C:H - The rnbd_srv_dev (kmalloc-512) is freed while still linked in the global dev_list, and other sessions' opens then run strncmp/kref_get_unless_zero on it. Re-occupying the freed slot gives a use-after-free read and leads to a double free that yields overlapping allocations, which can be used to leak kernel memory. I:H - After the kobject release frees the device, process_msg_open() writes to the freed memory via mutex_unlock/mutex_lock on srv_dev->lock and open_write_cnt--. destroy_device() then does list_del() using pointers read from the freed object and a second kfree(), a double free exploitable for heap corruption and control-flow hijack. A:H - The double kfree, the list_del() on a reallocated object, and the mutex slow path running on freed wait_list memory crash the storage server. A remote client can repeat the race at will.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 8cee532f469bbcdb6ac0ab161ebff36fbc6439d7 to 49f610e56795fe59acbedb673288606a4d6219ba (excl.)
  • affected from 8cee532f469bbcdb6ac0ab161ebff36fbc6439d7 to f65028b2fadec4919b77bc55130ab8401800fbe0 (excl.)
  • affected from 8cee532f469bbcdb6ac0ab161ebff36fbc6439d7 to 93deb589f24224dfc43e5dc03c3f9c9ea2e893cd (excl.)
  • affected from 8cee532f469bbcdb6ac0ab161ebff36fbc6439d7 to c44b41827bc8aa8dbc7c6a21be30c27e3cb606a2 (excl.)
  • affected from 8cee532f469bbcdb6ac0ab161ebff36fbc6439d7 to 6e1b4893c19d681a35c7889e566044bf7b3a4128 (excl.)
  • affected from 8cee532f469bbcdb6ac0ab161ebff36fbc6439d7 to f000dff3584a5f79ab8006fd019618f01c4d4918 (excl.)
  • affected from 8cee532f469bbcdb6ac0ab161ebff36fbc6439d7 to d9667ade40f986c565769a900ced6ee95edd33c6 (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