Instituto Nacional de ciberseguridad. Sección Incibe
Instituto Nacional de Ciberseguridad. Sección INCIBE-CERT

CVE-2026-63918

Gravedad CVSS v3.1:
ALTA
Tipo:
No Disponible / Otro tipo
Fecha de publicación:
19/07/2026
Última modificación:
20/07/2026

Descripción

*** Pendiente de traducción *** In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname<br /> <br /> A reader in l2tp_session_get_by_ifname() can return a pointer to a<br /> session whose refcount has reached zero. The getter takes its<br /> reference with plain refcount_inc(), but every other session getter<br /> in the same file (l2tp_v2_session_get, l2tp_v3_session_get, and the<br /> corresponding _get_next variants) uses refcount_inc_not_zero()<br /> because the IDR/RCU lookup can race with refcount_dec_and_test() -&gt;<br /> l2tp_session_free() -&gt; kfree_rcu(). The ifname getter is the only<br /> outlier; the inconsistency was raised on-list after 979c017803c4<br /> ("l2tp: use list_del_rcu in l2tp_session_unhash").<br /> <br /> A reader inside rcu_read_lock_bh() that matches session-&gt;ifname can<br /> be preempted between the strcmp() and the refcount_inc(). If the<br /> last reference drops on another CPU in that window, the reader&amp;#39;s<br /> refcount_inc() runs on a counter that has reached zero. refcount_t<br /> catches the addition-on-zero, prints "refcount_t: addition on 0;<br /> use-after-free", saturates the counter, and returns the saturated<br /> pointer to the caller. Session memory is held live by the in-flight<br /> RCU read section, but the kfree_rcu() callback queued from<br /> l2tp_session_free() will free it once the grace period closes; a<br /> caller that dereferences the returned session past that point hits<br /> a slab-use-after-free. On PREEMPT_RT local_bh_disable() is a per-CPU<br /> sleeping lock and the preemption window is real; on stock PREEMPT<br /> kernels local_bh_disable() is a preempt_count increment that closes<br /> the cross-CPU race in practice (see below).<br /> <br /> Use refcount_inc_not_zero() and continue the list walk on failure,<br /> matching the other session getters in the file. The ifname getter<br /> is the only session getter in net/l2tp/ that still uses the bare<br /> refcount_inc() pattern; this change restores file-internal<br /> consistency. The success path is unchanged.