CVE-2026-72317 in Linuxinfo

Summary

by MITRE • 08/15/2026

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

SUNRPC: pin upper rpc_clnt across the TLS connect_worker

The TLS connect path has a use-after-free: nothing pins the upper rpc_clnt across the delayed connect_worker. xs_connect() stores task->tk_client in sock_xprt::clnt as a raw pointer and queues the worker; for TLS-secured transports that worker is xs_tcp_tls_setup_socket(), which reads several fields out of the saved pointer (cl_timeout, cl_program, cl_prog, cl_vers, cl_cred, cl_stats) to construct the args for the inner handshake rpc_clnt.

The xprt does not reference the rpc_clnt; the rpc_clnt references the xprt. xs_destroy() does cancel the connect_worker, but it runs only when the xprt's refcount drops to zero, which cannot happen until the rpc_clnt releases its cl_xprt reference in rpc_free_client_work(). When a TLS handshake fails fatally (for example, an mTLS mount whose client cert does not match the server), the connecting task is woken with -EACCES and exits, the mount caller invokes rpc_shutdown_client(), and the upper rpc_clnt is freed before the queued connect_worker fires. xs_tcp_tls_setup_socket() then dereferences the freed clnt, producing the refcount_t underflow Michael Nemanov reported.

Take a reference on the upper rpc_clnt in xs_connect() for TLS transports via a new rpc_hold_client() helper, and drop it in the connect_worker's exit path with rpc_release_client(). The xprt_lock_connect() / xprt_unlock_connect() pairing already serialises xs_connect() with xs_tcp_tls_setup_socket(), so the take and release are balanced one-for-one.

The non-TLS connect worker (xs_tcp_setup_socket) never reads sock_xprt::clnt, so leave that path alone and avoid the clnt-holds-xprt-holds-clnt cycle that would otherwise prevent xprt destruction.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 08/15/2026

This vulnerability exists within the Linux kernel's sunrpc subsystem specifically affecting TLS-secured network transports. The issue stems from improper reference counting mechanisms during the RPC client connection process, creating a use-after-free condition that can lead to system instability and potential security exploitation. The problem manifests when establishing TLS connections through the rpc_clnt structure, where the upper-level client object is not properly pinned across asynchronous operations.

The technical flaw occurs in the TLS connect path where the xs_connect() function stores a raw pointer to task->tk_client in sock_xprt::clnt without maintaining proper reference counts. This creates a race condition where the connect_worker thread (xs_tcp_tls_setup_socket) may attempt to access freed memory after the rpc_clnt structure has been destroyed. The xs_destroy() function properly cancels the worker but only executes when the xprt's reference count reaches zero, which cannot occur until rpc_free_client_work() releases the cl_xprt reference held by the rpc_clnt. This timing discrepancy allows for a scenario where fatal TLS handshake failures cause immediate client destruction before the delayed worker can execute.

When a TLS handshake fails catastrophically, such as during mTLS mounts with mismatched certificates, the connecting task receives -EACCES error and exits normally. The mount caller then invokes rpc_shutdown_client() which frees the upper rpc_clnt structure before the queued connect_worker has an opportunity to run. The xs_tcp_tls_setup_socket() function subsequently dereferences this freed clnt pointer, resulting in a refcount_t underflow as reported by Michael Nemanov. This represents a classic use-after-free vulnerability that can be exploited to cause system crashes or potentially achieve privilege escalation.

The fix implements a targeted solution using new helper functions rpc_hold_client() and rpc_release_client() to properly manage the reference count for TLS transports. The approach takes a reference on the upper rpc_clnt in xs_connect() before queuing the TLS worker, ensuring the structure remains valid during asynchronous execution. The reference is released in the connect_worker's exit path through rpc_release_client(), maintaining proper one-for-one take and release semantics. This solution leverages existing synchronization mechanisms via xprt_lock_connect() / xprt_unlock_connect() pairing that already serializes xs_connect() with xs_tcp_tls_setup_socket(), eliminating the need for additional locking complexity.

The mitigation strategy specifically targets only TLS transport paths while leaving non-TLS connect workers unchanged to avoid creating circular reference dependencies. The non-TLS worker (xs_tcp_setup_socket) does not read sock_xprt::clnt, so preserving the existing behavior prevents potential deadlocks or resource management issues. This approach aligns with CWE-416 vulnerability classification for use-after-free conditions and addresses ATT&CK technique T1068 by preventing unauthorized privilege escalation through kernel memory corruption exploits. The solution maintains system stability while ensuring proper resource cleanup and reference counting across the complex asynchronous RPC connection lifecycle.

Responsible

Linux

Reservation

08/09/2026

Disclosure

08/15/2026

Moderation

accepted

CPE

ready

EPSS

0.00209

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!