CVE-2026-45951: bpf: Fix a potential use-after-free of BTF object
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix a potential use-after-free of BTF object
Refcounting in the check_pseudo_btf_id() function is incorrect:
the __check_pseudo_btf_id() function might get called with a zero refcounted btf. Fix this, and patch related code accordingly.
v3: rephrase a comment (AI)
v2: fix a refcount leak introduced in v1 (AI)
The Linux kernel CVE team has assigned CVE-2026-45951 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.14 with commit 76145f7255326761dafb76721a785799d8a00d5f and fixed in 6.18.14 with commit eac65c272f3b49021a843cba5107d63627395e0e Issue introduced in 6.14 with commit 76145f7255326761dafb76721a785799d8a00d5f and fixed in 6.19.4 with commit 9ff46ffeecdb1802d6e26183177935b948a12e7f Issue introduced in 6.14 with commit 76145f7255326761dafb76721a785799d8a00d5f and fixed in 7.0 with commit ccd2d799ed4467c07f5ee18c2f5c59bcc990822c
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-45951
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
kernel/bpf/verifier.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/eac65c272f3b49021a843cba5107d63627395e0e https://git.kernel.org/stable/c/9ff46ffeecdb1802d6e26183177935b948a12e7f https://git.kernel.org/stable/c/ccd2d799ed4467c07f5ee18c2f5c59bcc990822c