CVE-2026-63918: l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname

Published Jul 19, 2026
·
Updated

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

l2tp: use refcountincnotzero in l2tpsessiongetbyifname

A reader in l2tpsessiongetbyifname() can return a pointer to a session whose refcount has reached zero. The getter takes its reference with plain refcountinc(), but every other session getter in the same file (l2tpv2sessionget, l2tpv3sessionget, and the corresponding getnext variants) uses refcountincnotzero() because the IDR/RCU lookup can race with refcountdecandtest() -> l2tpsessionfree() -> kfreercu(). The ifname getter is the only outlier; the inconsistency was raised on-list after 979c017803c4 ("l2tp: use listdelrcu in l2tpsessionunhash").

A reader inside rcureadlockbh() that matches session->ifname can be preempted between the strcmp() and the refcountinc(). If the last reference drops on another CPU in that window, the reader's refcountinc() runs on a counter that has reached zero. refcountt catches the addition-on-zero, prints "refcountt: 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 kfreercu() callback queued from l2tpsessionfree() 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 PREEMPTRT localbhdisable() is a per-CPU sleeping lock and the preemption window is real; on stock PREEMPT kernels localbhdisable() is a preemptcount increment that closes the cross-CPU race in practice (see below).

Use refcountincnotzero() 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 refcountinc() pattern; this change restores file-internal consistency. The success path is unchanged.

Affected Software

15 affected componentsFixes available
Linux Kernel
Linux Linux kernel>=6.12<6.12.93
Linux Linux kernel>=6.13<6.18.35
Linux Linux kernel>=6.19<7.0.12
Linux Linux kernel=7.1-rc1
Linux Linux kernel=7.1-rc2
Linux Linux kernel=7.1-rc3
Linux Linux kernel=7.1-rc4
Linux Linux kernel=7.1-rc5
debian/linux<6.12.94-1
6.12.94-1
debian/linux<7.0.12-1
7.0.12-1
linux/kernel>=6.12.0<6.12.93
6.12.93
linux/kernel>=6.13.0<6.18.35
6.18.35
linux/kernel>=6.19.0<7.0.12
7.0.12
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.94-1
  2. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 7.0.12-1
  3. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.14-1
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.93
  5. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.35
  6. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.0.12

Event History

Jul 19, 2026
CVE Published
via MITRE·02:55 PM
Data Sourced
via MITRE·02:55 PM
DescriptionSeverity
Data Sourced
via OSV·02:55 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·04:17 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What conditions are required to trigger this issue?

A local attacker needs the ability to race L2TP session lookup by interface name against teardown of the same session. The race occurs when a reader is preempted after matching session->ifname but before taking its reference, while another CPU drops the final session reference.

2

How can administrators identify signs that the system encountered this race?

The kernel may emit the diagnostic "refcount_t: addition on 0; use-after-free" when the affected lookup attempts to increment a session reference count that has reached zero. This indicates the unsafe reference acquisition path was reached.

3

What code behavior fixes the problem?

The affected L2TP interface-name session getter must acquire references with refcount_inc_not_zero() rather than refcount_inc(). This prevents returning a session pointer after its reference count has reached zero.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203