CRITICAL Introduced in 2.6.15
sunrpc SocketCallback Race
CVE-2026-90235
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI6.9MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: sunrpc: xprtsock: annotate shared socket callbacks with READ_ONCE/WRITE_ONCE xprtsock replaces and restores sk->sk_data_ready and sk->sk_write_space on live sockets with plain stores, and xs_udp_do_set_buffer_size() invokes sk->sk_write_space via a plain load. These callback pointers are shared with generic socket and protocol paths that may read or invoke them concurrently, so xprtsock needs the same READ_ONCE()/WRITE_ONCE() callback visibility contract that the validated 4022 family applied elsewhere. When SUNRPC takes over an AF_LOCAL, UDP, or TCP socket and later restores the lower-socket callbacks during teardown, another CPU may still hold an earlier callback snapshot. The plain replace/restore pattern leaves the same visibility hole as the validated 4022 family, so a stale snapshot can still invoke xs_data_ready() or xs_udp_write_space() after the live callback fields have already been restored to the lower-socket handlers. Use WRITE_ONCE() for the shared sk_data_ready and sk_write_space stores in xs_local_finish_connecting(), xs_udp_finish_connecting(), xs_tcp_finish_connecting(), and xs_restore_old_callbacks(). Use READ_ONCE() for the direct sk_write_space invocation in xs_udp_do_set_buffer_size(). This matches the required callback visibility contract while leaving adjacent sk_state_change and sk_error_report handling unchanged.
02KernelScan AI Analysis
Risk summary
A race condition in the SUNRPC client socket transport allows a stale callback pointer to be invoked after socket teardown has restored the original handlers, leading to use-after-free on transport data. Any local user who can perform NFS I/O on an active NFS mount can trigger the race without special privileges. Successful exploitation can corrupt kernel memory or crash the kernel.
Vulnerability analysis
The NFS client transport replaces and restores socket callback pointers on live sockets during connection setup and teardown using plain stores, without ensuring those stores are visible to other processors that may read or invoke the callbacks concurrently. A concurrent socket event handler can hold a stale copy of the callback pointer and invoke the NFS callback after teardown has already restored the original handlers, causing the callback to access transport data that is being freed. The fix ensures all shared callback stores and direct callback reads use the proper visibility annotations, establishing the memory contract that prevents stale snapshots from surviving across processors. The vulnerable path is reachable by any local user who can trigger NFS or RPC operations on a system with active NFS mounts; no special capabilities are required.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 2.6.15 | 6.12.110 | 589f761236e0 |
| 7.2 | 2.6.15 | 7.2.6 | d8f0b8375380 |
| mainline | 2.6.15 | 7.3-rc1 | 33930840b5f0 |
| 6.18 | 2.6.15 | 6.18.52 | da652cb17f9f |
| 6.6 | 2.6.15 | 6.6.157 | ed80d009b154 |
| cip/6.12 | 2.6.15 | 6.12.111-cip32 | 589f761236e0 |