Skip to content
Heist/ feed
Back to feed
HighFix available

l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname

Type: advisorySources: OSV

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 ke

Products
Kernel
Affected versions
Not specified
Fixed versions
6.12.93, 6.18.35, 7.0.12
CVEs
CVE-2026-63918
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 03:21 UTC · Revision 1

Source evidence

l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname

core-osv · Original source

Published 19 Jul 2026, 14:55 UTC

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 ke

osv:CVE-2026-63918

Kernel

Fixed versions: 6.12.93, 6.18.35, 7.0.12

Complete source record
{
  "id": "1f55a29df41a733a7cbd6ce5667b715efbe0030b2887028d3c526f68308ce41c",
  "url": "https://osv.dev/vulnerability/CVE-2026-63918",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname",
    "summary": "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 ke",
    "evidence": "osv:CVE-2026-63918",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.12.93",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.18.35",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "7.0.12",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-63918",
      "aliases": [
        "CVE-2026-63918"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "abe7a1a7d0b69e63b1bca5f9531023a52336784f"
                },
                {
                  "fixed": "ee80455feffb9cb62b5b58715cabeff495e666b2"
                },
                {
                  "fixed": "947013fd7c8c35dd5856557b215840098a3f67f8"
                },
                {
                  "fixed": "782d60a6596aee9b29c2eecfa70033899278bf65"
                },
                {
                  "fixed": "05f95729ca844704d15e49ce14868af4b403b32b"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-63918.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.12.0"
                },
                {
                  "fixed": "6.12.93"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.18.35"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.19.0"
                },
                {
                  "fixed": "7.0.12"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-63918.json"
          }
        }
      ],
      "modified": "2026-11-01T02:31:03.203001029Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/05f95729ca844704d15e49ce14868af4b403b32b",
        "https://git.kernel.org/stable/c/782d60a6596aee9b29c2eecfa70033899278bf65",
        "https://git.kernel.org/stable/c/947013fd7c8c35dd5856557b215840098a3f67f8",
        "https://git.kernel.org/stable/c/ee80455feffb9cb62b5b58715cabeff495e666b2",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/63xxx/CVE-2026-63918.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-63918",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/63xxx/CVE-2026-63918.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-63918",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 517709,
  "published_at": "2026-07-19T14:55:21.414+00:00"
}