# CVE-2024-41045: bpf: Defer work in bpf\_timer\_cancel\_and\_free

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.33% (percentile 18, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-07-29T14:32:02.866Z
- **Modified:** 2026-10-30T13:17:30.927Z

## Who should check

- Anyone running Linux \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< 7b27f15cab4c7d4f28c25b94a5284ad6d9d3695d; \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< 5eaa11c500ed07f505f86cec07d5593a71927e26; \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< 7aa5a19279c3639ae8b758b63f05d0c616a39fa1; \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< a6fcd19d7eac1335eb76bc16b6a66b7f574d1d69
- Anyone running Linux 5.15

## 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.

## Affected and fixed versions

- Linux: \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< 7b27f15cab4c7d4f28c25b94a5284ad6d9d3695d; \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< 5eaa11c500ed07f505f86cec07d5593a71927e26; \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< 7aa5a19279c3639ae8b758b63f05d0c616a39fa1; \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< a6fcd19d7eac1335eb76bc16b6a66b7f574d1d69 (cvelist)
- Linux: 5.15 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-41045. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-41045.md
Affected: Linux >= b00628b1c7d595ae5b544e059c27b1f5828314b4, < 7b27f15cab4c7d4f28c25b94a5284ad6d9d3695d; >= b00628b1c7d595ae5b544e059c27b1f5828314b4, < 5eaa11c500ed07f505f86cec07d5593a71927e26; >= b00628b1c7d595ae5b544e059c27b1f5828314b4, < 7aa5a19279c3639ae8b758b63f05d0c616a39fa1; >= b00628b1c7d595ae5b544e0…
Fixed in: Linux 7b27f15cab4c7d4f28c25b94a5284ad6d9d3695d, Linux 5eaa11c500ed07f505f86cec07d5593a71927e26, Linux 7aa5a19279c3639ae8b758b63f05d0c616a39fa1

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-41045 being exploited?

There is no confirmed exploitation: CVE-2024-41045 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.33% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-41045?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-41045?

Linux \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< 7b27f15cab4c7d4f28c25b94a5284ad6d9d3695d; \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< 5eaa11c500ed07f505f86cec07d5593a71927e26; \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< 7aa5a19279c3639ae8b758b63f05d0c616a39fa1; \>= b00628b1c7d595ae5b544e059c27b1f5828314b4, \< a6fcd19d7eac1335eb76bc16b6a66b7f574d1d69; Linux 5.15.

### Is there a fix for CVE-2024-41045?

Yes. Fixed in Linux 7b27f15cab4c7d4f28c25b94a5284ad6d9d3695d, Linux 5eaa11c500ed07f505f86cec07d5593a71927e26, Linux 7aa5a19279c3639ae8b758b63f05d0c616a39fa1. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-41045?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/7aa5a19279c3639ae8b758b63f05d0c616a39fa1>
- patch: <https://git.kernel.org/stable/c/a6fcd19d7eac1335eb76bc16b6a66b7f574d1d69>
- other: <https://git.kernel.org/stable/c/7b27f15cab4c7d4f28c25b94a5284ad6d9d3695d>
- other: <https://git.kernel.org/stable/c/5eaa11c500ed07f505f86cec07d5593a71927e26>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-41045>

HTML: <https://flawdb.com/CVE-2024-41045> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-41045>
