Look up another CVE · open CVE-2026-63918 in the interactive tracker
CVE-2026-63918
l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname
Published 2026-07-19 (3 months ago) by the Linux kernel CNA. Subsystem net/l2tp. Debian urgency: unimportant.
What to do, per Debian release
Debian's own status for CVE-2026-63918 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source
| Release | Status | Version | What this means |
|---|---|---|---|
| Debian 12bookworm | not affected | 6.1.190-1 | Nothing to do. bookworm never shipped the vulnerable code. |
| Debian 13trixie | fixed | 6.12.94-1 | Update the kernel and reboot. Fixed in 6.12.94-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 7.0.12-1 | Update the kernel and reboot. Fixed in 7.0.12-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 7.0.12-1 | Update the kernel and reboot. Fixed in 7.0.12-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
A reader in l2tp_session_get_by_ifname() can return a pointer to a session whose refcount has reached zero. The getter takes its reference with plain refcount_inc(), but every other session getter in the same file (l2tp_v2_session_get, l2tp_v3_session_get, and the corresponding _get_next variants) uses refcount_inc_not_zero() because the IDR/RCU lookup can race with refcount_dec_and_test() -> l2tp_session_free() -> kfree_rcu(). The ifname getter is the only outlier; the inconsistency was raised on-list after 979c017803c4 ("l2tp: use list_del_rcu in l2tp_session_unhash"). A reader inside rcu_read_lock_bh() that matches session->ifname can be preempted between the strcmp() and the refcount_inc(). If the last reference drops on another CPU in that window, the reader's refcount_inc() runs on a counter that has reached zero. refcount_t catches the addition-on-zero, prints "refcount_t: addition on 0; use-after-free", saturates the counter, and returns the saturated pointer to the caller. Session memory is held live by the in-flight RCU read section, but the kfree_rcu() callback queued from l2tp_session_free() will free it once the grace period closes; a caller that dereferences the returned session past that point hits a slab-use-after-free. On PREEMPT_RT local_bh_disable() is a per-CPU sleeping lock and the preemption window is real; on stock PREEMPT kernels local_bh_disable() is a preempt_count increment that closes the cross-CPU race in practice (see below). Use refcount_inc_not_zero() and continue the list walk on failure, matching the other session getters in the file. The ifname getter is the only session getter in net/l2tp/ that still uses the bare refcount_inc() pattern; this change restores file-internal consistency. The success path is unchanged.
Where it lives
The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.
net/l2tp/l2tp_core.c
- What this is
- NETWORKING [GENERAL]MAINTAINERS section matched on net/ · netdev@vger.kernel.org · Maintained
- Kernel module
- l2tp_core
Check it on the machine
grep -w CONFIG_L2TP /boot/config-$(uname -r)Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.
lsmod | grep -w l2tp_corePrints a line if that module is loaded right now, and nothing if it is not. One that is not loaded can still be loaded later by anything that needs it.
Show whether Debian builds this, per release
Debian builds this as a loadable module. Every release below compiles it as a module on every flavour, so whether the code is in the running kernel depends on whether that module is loaded.
- bookworm, trixie, forky, sidm
- m
- a loadable module on every flavour - check lsmod, can be blacklisted
- Build switch
- CONFIG_L2TP
From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages
Signals
- Published
- 2026-07-19 (3 months ago)source
- CVSS
- 7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it - Attack vector
- local (AV:L)source
- EPSS
- 0.16%, higher than 5.2% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- unimportantsource
- Subsystem
- net/l2tp
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 6.12 | 6.12.93 | ee80455feffb |
| 6.12 | 6.18.35 | 947013fd7c8c |
| 6.12 | 7.0.12 | 782d60a6596a |
| 6.12 | 7.1 | 05f95729ca84 |
Why the CNA scored it this way
Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source
- AV:LAttack vector, local
- The vulnerable code is only reached via the L2TP genetlink management API (netlink syscall), not from the L2TP data-plane packet receive path. Attackers must issue local netlink commands such as SESSION_GET, SESSION_DELETE, or SESSION_MODIFY with L2TP_ATTR_IFNAME.
- AC:LAttack complexity, low
- Exploitation requires racing session lookup-by-ifname against concurrent session deletion, and an attacker with CAP_NET_ADMIN can control both sides by issuing parallel netlink operations. On PREEMPT_RT kernels the preemption window between strcmp() and refcount_inc() is real and reliably winnable.
- PR:LPrivileges required, low
- All affected genetlink commands are gated by GENL_UNS_ADMIN_PERM, requiring CAP_NET_ADMIN in the network namespace. That capability is obtainable by unprivileged users via user/network namespaces (unshare -Urn), not only by init-namespace root.
- UI:NUser interaction, none
- No victim interaction is required; the attacker triggers the race directly through netlink management commands without needing another user to mount, open, or configure anything.
- S:UScope, unchanged
- Impact is confined to kernel memory corruption and privilege escalation within the same kernel security domain. This is not a VM escape, sandbox boundary cross, or IOMMU bypass.
- C:HConfidentiality impact, high
- The bug is a slab use-after-free on struct l2tp_session; returning and later dereferencing a session whose refcount reached zero enables reading freed kernel heap memory and leaking kernel pointers or other sensitive data.
- I:HIntegrity impact, high
- UAF on struct l2tp_session corrupts a heap object that contains function pointers (recv_skb, session_close) and is subsequently used by session_delete/modify/notify handlers, enabling arbitrary kernel write or code execution via heap grooming.
- A:HAvailability impact, high
- Dereferencing the freed l2tp_session after the RCU grace period causes kernel oops or panic. Even failed exploitation attempts trigger refcount_t "addition on 0; use-after-free" warnings and can crash the system under load.