7.8

CVE-2024-41045: bpf: Defer work in bpf_timer_cancel_and_free

Modified
AliasesUBUNTU-CVE-2024-41045DEBIAN-CVE-2024-41045
Published 29-07-2024Last modified 30-10-2026

Vulnerability summary

CVE-2024-41045 is a high (CVSS 7.8) Use After Free vulnerability in linux. EPSS estimates a 0.30% chance of exploitation in the next 30 days, higher than 23.8% of scored vulnerabilities.

Priority
Routine

Not severe (CVSS 7.8, local access); no exploitation reported by the 5 checked sources

Source freshness unavailable

How is this decided?
CVSS score
7.8/10
010
High · v3.1 (CVE.org)
EPSS score
0.30%
0%100%
Low · +0.01 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 19 · Related 18

Timeline

  1. 29-07-2024
    PublishedVulnerability first disclosed.
  2. 30-10-2026
    Last modifiedVulnerability information updated.

Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Defer work in bpf_timer_cancel_and_free Currently, the same case as previous patch (two timer callbacks trying to cancel each other) can be invoked through bpf_map_update_elem as well, or more precisely, freeing map elements containing timers. Since this relies on hrtimer_cancel as well, it is prone to the same deadlock situation as the previous patch. It would be sufficient to use hrtimer_try_to_cancel to fix this problem, as the timer cannot be enqueued after async_cancel_and_free. Once async_cancel_and_free has been done, the timer must be reinitialized before it can be armed again. The callback running in parallel trying to arm the timer will fail, and freeing bpf_hrtimer without waiting is sufficient (given kfree_rcu), and bpf_timer_cb will return HRTIMER_NORESTART, preventing the timer from being rearmed again. However, there exists a UAF scenario where the callback arms the timer before entering this function, such that if cancellation fails (due to timer callback invoking this routine, or the target timer callback running concurrently). In such a case, if the timer expiration is significantly far in the future, the RCU grace period expiration happening before it will free the bpf_hrtimer state and along with it the struct hrtimer, that is enqueued. Hence, it is clear cancellation needs to occur after async_cancel_and_free, and yet it cannot be done inline due to deadlock issues. We thus modify bpf_timer_cancel_and_free to defer work to the global workqueue, adding a work_struct alongside rcu_head (both used at _different_ points of time, so can share space). Update existing code comments to reflect the new state of affairs.

CVSS metrics

5 scores · 4 sources · 2 versions

EPSS trend

Probability

0.30%

Chance of exploitation in the next 30 days

Percentile

24%

Versus all other CVEs

30-day change

Increase +0.01 pp

From 0.29% on 04-11-2026

04-11-202604-12-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: local access, low-privilege account, no user interaction (CVSS vector). Other conditions: not stated in public data.

Ubuntu119 products
  • linuxAll versions (No fix recorded) | < 6.8.0-48.48
  • linux-allwinner-5.19All versions (No fix recorded)
  • linux-awsAll versions (No fix recorded) | < 6.8.0-1018.20
  • linux-aws-5.0All versions (No fix recorded)
  • linux-aws-5.11All versions (No fix recorded)
Linux2 products
  • linux≥ b00628b1c7d595ae5b544e059c27b1f5828314b4, < 7b27f15cab4c7d4f28c25b94a5284ad6d9d3695d | ≥ b00628b1c7d595ae5b544e059c27b1f5828314b4, < 5eaa11c500ed07f505f86cec07d5593a71927e26 | ≥ b00628b1c7d595ae5b544e059c27b1f5828314b4, < 7aa5a19279c3639ae8b758b63f05d0c616a39fa1 | ≥ b00628b1c7d595ae5b544e059c27b1f5828314b4, < a6fcd19d7eac1335eb76bc16b6a66b7f574d1d69 | 5.15
  • linux_kernel≥ 5.15, < 6.9.10 | 6.10:rc1 | 6.10:rc2 | 6.10:rc3 | 6.10:rc4 | 6.10:rc5 | 6.10:rc6 | 6.10:rc7
Debian1 product
  • linuxAll versions (No fix recorded) | < 6.1.192-1 | < 6.9.10-1

3 vendors · 122 products

References

18 links
Show all 18 references