CVE-2024-41045
Last modified
CVE-2024-41045 is a high-severity vulnerability rated 7.8/10 on the CVSS scale. 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. EPSS estimates a 0.27% chance of exploitation in the next 30 days.
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.
Metrics
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness Enumeration
Affected Software
| Vendor | Product | Versions | Update |
|---|---|---|---|
| Linux | Linux Kernel | >= 5.15, < 6.9.10 | — |
| Linux | Linux Kernel | 6.10 | Rc1 |
References
Timeline
- Published
- Last Modified
- Status
- Modified
Frequently Asked Questions
What is CVE-2024-41045?
How severe is CVE-2024-41045?
How do I fix CVE-2024-41045?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2024
- CVE-2024-4104The ADFO – Custom data in admin dashboard plugin for WordPre…6.1
- CVE-2024-41040In the Linux kernel, the following vulnerability has been re…7
- CVE-2024-41041In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-41042In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2024-41043In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-41044In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-41046In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2024-41047In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-41048In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-41049In the Linux kernel, the following vulnerability has been re…7
- CVE-2024-4105A vulnerability has been found in FAST/TOOLS and CI Server. …5.8
- CVE-2024-41050In the Linux kernel, the following vulnerability has been re…7.8
Are you affected by CVE-2024-41045?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
