CVE-2024-40909

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

7.8 high EPSS 0.28%

Published 12 Jul 2024 Updated 30 Oct 2026 CNA: Linux

Check your servers for CVE-2024-40909

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-40909 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Severity (CVSS)

7.8 high CVSS 3.1 from Linux (CNA)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
low: an attack works without special conditions
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.28%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 21.7% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 10 Sep 2024):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from ac48dc6ac9240f73bf08d29edf65c2deca93ee5d, before e8ccda39b395169622855607085cdeef4d376e0f
affected from 876941f533e7b47fc69977fc4551c02f2d18af97, before 91cff53136daeff50816b0baeafd38a6976f6209
affected from 1a80dbcb2dbaf6e4c216e62e30fa7d3daa8001ce, before fa97b8fed9896f1e89cb657513e483a152d4c382
affected from 1a80dbcb2dbaf6e4c216e62e30fa7d3daa8001ce, before 2884dc7d08d98a89d8d65121524bb7533183a63a
affected 5d8d447777564b35f67000e7838e7ccb64d525c8
affected from 6.6.26, before 6.6.35
affected from 6.8.5, before 6.9
Other versions: unaffected
Linux
affected 6.9
unaffected before 6.9
unaffected from 6.6.35 up to and including 6.6.*
unaffected from 6.9.6 up to and including 6.9.*
unaffected 6.10 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-40909 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-40909

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2024-40909
trivy image --scanners vuln IMAGE | grep CVE-2024-40909

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2024-40909 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.