⚠️

Disclaimer & Liability

The content provided on this website is for educational, research, and security awareness purposes only. Any unauthorized, illegal, or abusive use of the information, tools, and techniques discussed is solely the responsibility of the user. The author and publisher assume no liability for any damages, injuries, or consequences resulting from the misuse of this content.

CVE-2026-139112: Linux rnbd-srv Race Condition Can Expose an Incompletely Initialized Session Object | Alireza Bolbolabadi - Red Team Security
LOADING

CVE-2026-139112: Linux rnbd-srv Race Condition Can Expose an Incompletely Initialized Session Object

Executive summary

CVE-2026-139112 addresses a race condition in the Linux kernel’s rnbd-srv subsystem. During device OPEN processing, rnbd_sess_dev_alloc() inserted a newly allocated sess_dev into an XArray before its bdev_file field had been initialized and before the operation could no longer fail.

That early publication creates two unsafe concurrency paths. Another connection can submit an I/O message with the newly assigned session ID and locate the incompletely initialized object. Alternatively, if OPEN fails, the error path can free sess_dev while concurrent I/O processing retains a reference to it. The source advisory characterizes the latter condition as a use-after-free risk and notes that an RCU grace period alone does not make the lifetime arrangement safe.

The affected surface is the network-accessible rnbd server interface. The advisory states that both paths are reachable from any host able to open a device. Nevertheless, the available intelligence records no known exploitation, provides no CVSS vector, and does not document a public proof of concept or a dependable path to privilege escalation or data corruption. The appropriate real-world severity is therefore assessed as low.

Affected systems

The affected product is the Linux kernel, specifically the rnbd-srv subsystem used for remote network block device access. The vulnerable behavior is located in rnbd_sess_dev_alloc() during device OPEN processing.

The supplied advisory does not identify:

  • An affected version range or stable branch;

  • The first fixed Linux kernel release;

  • An upstream commit hash;

  • Whether the fix has been backported by a particular distribution; or

  • Whether particular configurations expose rnbd by default.

Consequently, the exact set of vulnerable installations cannot be established from the available information. Systems running the Linux kernel with rnbd-srv enabled or reachable should be treated as potentially affected until their distribution vendor confirms that the complete upstream correction is present.

Technical analysis

Root cause

rnbd_sess_dev_alloc() creates a session object and immediately stores it in an XArray under a newly assigned session ID. At that point, the object’s bdev_file field has not yet been set, and the surrounding OPEN operation can still fail.

Publishing the object at that early stage makes it discoverable by other connections before it has reached a safe state. The intended correction changes the publication order:

  1. Reserve the new ID by inserting a NULL entry into the XArray.

  1. Complete initialization of sess_dev.

  1. Publish the actual sess_dev only when the operation can no longer fail.

  1. Erase the reserved ID if OPEN fails.

  1. Remove the error path’s dependency on synchronize_rcu().

This approach prevents another connection from obtaining a usable reference to the object while it is incomplete or eligible for release.

Unsafe access during a successful OPEN

A remote connection can send an I/O message carrying the newly issued session ID while the original OPEN request is still being processed. Concurrent handling may find the sess_dev in the XArray before bdev_file is assigned.

The critical boundary is not merely network reachability, but the ability to act on the new ID during the initialization window. The supplied source does not describe the exact protocol mechanics, authentication requirements, or whether a malformed request is needed. It establishes that the race is reachable from a host able to open a device.

Object lifetime on the OPEN error path

If OPEN fails after the session object has been published, the error path can free sess_dev. Concurrent I/O processing may already have located the object and retained a reference, allowing it to continue operating on released memory.

Waiting for an RCU grace period does not, by itself, correct this arrangement. The upstream solution avoids exposing the actual object until no later failure can release it, eliminating the problematic lifetime transition rather than relying solely on deferred reclamation.

Real-world impact

The available evidence supports a confirmed concurrency flaw with a potential use-after-free, but it does not demonstrate a mature exploit chain or sustained attack campaign.

Relevant risk signals include:

  • The vulnerability is reachable over the network through the rnbd interface.

  • Exploitation depends on concurrent activity involving the newly assigned session ID.

  • No CVSS score or vector is available in the supplied intelligence.

  • CVE-2026-139112 is not listed in the CISA KEV catalog.

  • No exploitation evidence, public exploit, or proof of concept is recorded.

  • The source does not establish reliable crashes, privilege escalation, security-boundary violations, or data corruption.

These factors support a low severity assessment. The low rating does not mean the code path is harmless; it reflects the absence of evidence that the timing conditions can be converted into a reliable, high-impact attack.

Mitigation

Apply the complete upstream rnbd-srv fix through the kernel package or source tree used by the environment. The corrected behavior reserves the session ID with a NULL XArray entry, publishes sess_dev only after initialization can no longer fail, erases the ID on the error path, and removes the need for synchronize_rcu() on that path.

Because the supplied context does not name the upstream commit or fixed kernel versions, the relevant distribution’s security advisory, package changelog, or vendor support channels should be used to confirm whether the fix is present and backported. A kernel update should contain the complete upstream correction rather than an independently reconstructed partial change.

Where patching is not yet available, access to the rnbd server interface can be restricted to trusted, authorized hosts and networks. If the service is unnecessary, stopping or disabling it removes the exposed attack surface. These measures reduce exposure but do not eliminate the race for authorized peers.

Detection and monitoring

Administrators can watch for kernel warnings or crashes associated with rnbd-srv, sess_dev, XArray access, bdev_file, use-after-free diagnostics, invalid object access, and related kernel fault signatures. Service and network logs may also reveal repeated device-open attempts, unusual I/O messages involving newly issued session IDs, or connections from outside the expected access set.

No dedicated detection signature is supplied with the advisory. Generic crash telemetry can indicate that an affected system is exercising the faulty path, while unexpected network access can help quantify exposure. Neither signal alone confirms exploitation.

Expert insight

This issue illustrates why object publication is a security boundary in concurrent kernel code. Allocating an object and exposing its identifier are separate events: once an identifier becomes discoverable, other execution contexts may treat the associated object as valid. The unsafe assumption was that an RCU grace period could compensate for publishing a partially initialized object and permit later cleanup.

The stronger design is to reserve the identifier without exposing the object, finish all fallible initialization, and publish the pointer only at the point where the object is safe to consume. That ordering prevents concurrent code from acquiring a reference during either the initialization window or a later failure path.

Actionable recommendations

  1. Check the kernel package and distribution advisory to determine whether the complete upstream rnbd-srv correction is installed.

  1. Prioritize the update on systems where the rnbd server interface is reachable by hosts outside a tightly controlled trust boundary.

  1. Restrict rnbd access to authorized networks and hosts until the relevant kernel fix is confirmed.

  1. Stop or disable rnbd when remote network block device access is not required.

  1. Monitor kernel diagnostics and rnbd service logs for use-after-free warnings, invalid access, crashes, repeated device opens, and anomalous session activity.

advisory informational CVE-2026-139112
·
← Back to Writeups