CVE-2024-40909

bpf: Fix a potential use-after-free in bpf_link_free()

HIGH
7.8
CVSS Score
Published: July 12, 2024 at 12:20 PM UTC
Updated: August 5, 2026 at 12:04 PM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 0.3%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix a potential use-after-free in bpf_link_free() After commit 1a80dbcb2dba, bpf_link can be freed by link->ops->dealloc_deferred, but the code still tests and uses link->ops->dealloc afterward, which leads to a use-after-free as reported by syzbot. Actually, one of them should be sufficient, so just call one of them instead of both. Also add a WARN_ON() in case of any problematic implementation.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 6.8.56.6.26 ≤ v < 6.6.356.8.5 ≤ v < 6.96.9 ≤ v < 6.106.9 ≤ v < 6.9.61a80dbcb2dbaf6e4c216e62e30fa7d3daa8001ce5d8d447777564b35f67000e7838e7ccb64d525c86.10 rc16.10 rc26.6.266.8.5876941f533e7b47fc69977fc4551c02f2d18af97
Vendor states this is fixed in 2884dc7d08d98a89d8d65121524bb7533183a63a (fixed)
Vendor states this is fixed in 91cff53136daeff50816b0baeafd38a6976f6209 (fixed)
Vendor states this is fixed in fa97b8fed9896f1e89cb657513e483a152d4c382 (fixed)
Vendor states this is fixed in 6.10 (unaffected)
Vendor states this is fixed in 6.6.35 (unaffected)
Vendor states this is fixed in 6.9 (unaffected)
Vendor states this is fixed in 6.9.6 (unaffected)

References (3)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/2884dc7d08d98a89d8d65121524bb7533183a63a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/91cff53136daeff50816b0baeafd38a6976f6209
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/fa97b8fed9896f1e89cb657513e483a152d4c382

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.8HIGHLinux
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-416

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card