CVE-2026-139113: rnbd-srv: fix use-after-free on two CLOSE messages
In the Linux kernel, the following vulnerability has been resolved:
rnbd-srv: fix use-after-free on two CLOSE messages
processmsgclose() looks the sessdev up with a kref, drops it right away, and only then takes the session mutex for the teardown. A session has several connections handled by different workers, so two CLOSE messages for the same ID both finish the lookup before either one tears the sessdev down, and the second one works on freed memory. Any host that can open a device on the server can do that.
Take the mutex first and look the ID up with xaload() under it. The second CLOSE then finds nothing.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In rnbd-srv, take the session mutex before looking up the ID, and perform the lookup with xa_load() while holding the mutex.