CVE-2026-53262: l2tp: pppol2tp: hold reference to session in pppol2tp_ioctl()
In the Linux kernel, the following vulnerability has been resolved:
l2tp: pppol2tp: hold reference to session in pppol2tpioctl()
pppol2tpioctl() read sock->sk->skuserdata directly without any locks or reference counting. If a controllable sleep was induced during copyfromuser() (e.g. via a userfaultfd page fault sleep), a concurrent socket close could trigger pppol2tpsessionclose() asynchronously. This frees the l2tpsession structure via the l2tpsessiondelwork workqueue. Upon resuming, the ioctl thread dereferences the stale session pointer, resulting in a Use-After-Free (UAF).
Fix this by securely fetching the session reference using the RCU-safe, refcounted helper pppol2tpsocktosession(sk) on entry. This locks the session's refcount across the sleep. We structured the function to exit via standard err breaks, guaranteeing that l2tpsessionput() is cleanly called on all return paths to drop the reference.
To preserve existing behavior we validate the session and its magic signature only for the specific L2TP commands that require it. This ensures that generic/unknown ioctls called on an unconnected socket still return -ENOIOCTLCMD and correctly fall back to generic handlers (e.g. in sockdoioctl()).
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
In pppol2tp_ioctl(), avoid reading sock->sk->sk_user_data directly without a refcounted helper. Hold a valid session reference across the sleep and ensure each return path drops the reference (e.g., via a structured function exit and explicit l2tp_session_put() on all paths) to prevent Use-After-Free when the session pointer can become stale during concurrent socket close.
Linux kernel (l2tp: pppol2tp) pppol2tp_ioctl session handling = Use an RCU-safe refcounted helper and hold/release session reference across any sleep instead of directly reading sock->sk->sk_user_data
Event History
Frequently Asked Questions
What is the severity of CVE-2026-53262?
CVE-2026-53262 has a severity rating of 55.
How do I fix CVE-2026-53262?
To fix CVE-2026-53262, update the Linux kernel to the latest version where this vulnerability has been addressed.
What is the nature of CVE-2026-53262?
CVE-2026-53262 is a use-after-free vulnerability in the Linux kernel related to the pppol2tp_ioctl() function.
What impact does CVE-2026-53262 have on affected systems?
CVE-2026-53262 can lead to potential memory corruption and attacker exploitation on affected Linux systems.
Which software systems are affected by CVE-2026-53262?
CVE-2026-53262 affects the Linux kernel specifically related to the L2TP protocol.