Linux Kernel L2TP Refcount Vulnerability in Session Management

Vulnerability

A use-after-free vulnerability has been identified in the Linux kernel's L2TP (Layer 2 Tunneling Protocol) implementation. The issue arises in the function 'l2tp_session_get_by_ifname()', which can return a pointer to a session whose reference count has already reached zero. This occurs because the function uses 'refcount_inc()' to increase the reference count, leaving it vulnerable to a race condition. In contrast, other session retrieval functions in the same file properly use 'refcount_inc_not_zero()' to avoid such issues. The vulnerability can lead to a slab-use-after-free condition, where memory is freed while still being accessed, potentially causing memory corruption or other unintended behavior.

Impact

Exploitation of this vulnerability causes a use-after-free condition, where a freed memory area is accessed, leading to potential memory corruption.

Reproduction

The vulnerability can be reproduced by calling the 'l2tp_session_get_by_ifname()' function with a session name that matches an existing session. The function will incorrectly return a pointer to a session whose reference count has dropped to zero, due to a race condition between the reference count management and the session lookup process.

Remediation

The vulnerability has been fixed in the Linux kernel. Users should upgrade to the latest version where this issue has been addressed.

Added: Jul 19, 2026, 8:05 PM
Updated: Jul 19, 2026, 8:05 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
1.3
exploitability
3.9
remediation
7.7
relevance
9.7
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.