In the Linux kernel, the following vulnerability has been resolved:
l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname
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.
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Debian | — | Upgrade linux | Jul 23, 2026 | Jul 23, 2026 |
| Ubuntu | — | Upgrade linux-image-7.0.0-1010-ibmUpgrade linux-image-nvidiaUpgrade linux-image-7.0.0-1010-azureUpgrade linux-image-7.0.0-1009-aws-64kUpgrade linux-image-oracle-7.0Upgrade linux-image-raspi-realtime-7.0Upgrade linux-image-7.0.0-1016-nvidiaUpgrade linux-image-7.0.0-1015-raspiUpgrade linux-image-nvidia-hwe-26.04Upgrade linux-image-7.0.0-1008-oracle-64kUpgrade linux-image-aws-64kUpgrade linux-image-aws-64k-7.0Upgrade linux-image-azure-fde-7.0Upgrade linux-image-ibm-7.0Upgrade linux-image-aws-7.0Upgrade linux-image-7.0.0-1015-raspi-realtimeUpgrade linux-image-nvidia-bos-7.0Upgrade linux-image-nvidia-64k-7.0Upgrade linux-image-7.0.0-2016-nvidia-bosUpgrade linux-image-7.0.0-1011-oracle-64kUpgrade linux-image-nvidia-bosUpgrade linux-image-gcp-7.0Upgrade linux-image-7.0.0-2016-nvidia-bos-64kUpgrade linux-image-7.0.0-1009-azure-fdeUpgrade linux-image-ibmUpgrade linux-image-7.0.0-1009-awsUpgrade linux-image-gcp-64kUpgrade linux-image-nvidia-bos-64kUpgrade linux-image-raspi-realtimeUpgrade linux-image-nvidia-7.0Upgrade linux-image-7.0.0-1011-gcpUpgrade linux-image-gcp-64k-7.0Upgrade linux-image-nvidia-bos-64k-7.0Upgrade linux-image-7.0.0-1011-gcp-64kUpgrade linux-image-7.0.0-1008-oracleUpgrade linux-image-raspi-7.0Upgrade linux-image-raspiUpgrade linux-image-oracle-64k-7.0Upgrade linux-image-awsUpgrade linux-image-7.0.0-1011-oracleUpgrade linux-image-oracle-64kUpgrade linux-image-oracleUpgrade linux-image-nvidia-64k-hwe-26.04Upgrade linux-image-azureUpgrade linux-image-7.0.0-1016-nvidia-64kUpgrade linux-image-7.0.0-1014-azureUpgrade linux-image-nvidia-64kUpgrade linux-image-azure-fdeUpgrade linux-image-gcpUpgrade linux-image-azure-7.0 | Jul 21, 2026 | Jul 20, 2026 |
| Vmware Photon_os | — | Use 'tdnf update' to upgrade all packages to the latest version. | Aug 3, 2026 | Jul 19, 2026 |
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub