CVE-2026-23319
Severity CVSS v4.0:
Pending analysis
Type:
CWE-416
Use After Free
Publication date:
25/03/2026
Last modified:
23/04/2026
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
bpf: Fix a UAF issue in bpf_trampoline_link_cgroup_shim<br />
<br />
The root cause of this bug is that when &#39;bpf_link_put&#39; reduces the<br />
refcount of &#39;shim_link->link.link&#39; to zero, the resource is considered<br />
released but may still be referenced via &#39;tr->progs_hlist&#39; in<br />
&#39;cgroup_shim_find&#39;. The actual cleanup of &#39;tr->progs_hlist&#39; in<br />
&#39;bpf_shim_tramp_link_release&#39; is deferred. During this window, another<br />
process can cause a use-after-free via &#39;bpf_trampoline_link_cgroup_shim&#39;.<br />
<br />
Based on Martin KaFai Lau&#39;s suggestions, I have created a simple patch.<br />
<br />
To fix this:<br />
Add an atomic non-zero check in &#39;bpf_trampoline_link_cgroup_shim&#39;.<br />
Only increment the refcount if it is not already zero.<br />
<br />
Testing:<br />
I verified the fix by adding a delay in<br />
&#39;bpf_shim_tramp_link_release&#39; to make the bug easier to trigger:<br />
<br />
static void bpf_shim_tramp_link_release(struct bpf_link *link)<br />
{<br />
/* ... */<br />
if (!shim_link->trampoline)<br />
return;<br />
<br />
+ msleep(100);<br />
WARN_ON_ONCE(bpf_trampoline_unlink_prog(&shim_link->link,<br />
shim_link->trampoline, NULL));<br />
bpf_trampoline_put(shim_link->trampoline);<br />
}<br />
<br />
Before the patch, running a PoC easily reproduced the crash(almost 100%)<br />
with a call trace similar to KaiyanM&#39;s report.<br />
After the patch, the bug no longer occurs even after millions of<br />
iterations.
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.0.1 (including) | 6.1.167 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.130 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.12.77 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.13 (including) | 6.18.17 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.19 (including) | 6.19.7 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.0:-:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc6:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc7:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/3eeddb80191f7626ec1ef742bfff51ec3b0fa5c2
- https://git.kernel.org/stable/c/4e8a0005d633a4adc98e3b65d5080f93b90d356b
- https://git.kernel.org/stable/c/529e685e522b9d7fb379dbe6929dcdf520e34c8c
- https://git.kernel.org/stable/c/56145d237385ca0e7ca9ff7b226aaf2eb8ef368b
- https://git.kernel.org/stable/c/9b02c5c4147f8af8ed783c8deb5df927a55c3951
- https://git.kernel.org/stable/c/cfcfa0ca0212162aa472551266038e8fd6768cff



