CVE-2024-41045·Kernel vulnerability
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.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.9.10
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at <0.1% — higher than 2% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Read the two together. CVE-2024-41045 scores 7.8 on CVSS, so a successful attack would be serious — but at <0.1%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.
Affected versions
From: 5.15
Until: 6.9.10
Fixed in: 6.9.10
How to fix this CVE
Update your Linux kernel to version 6.9.10 or later to resolve a critical deadlock vulnerability in the eBPF timer subsystem. This patch defers timer cancellation work to prevent race conditions when map elements containing timers are freed or when nested timer callbacks attempt to cancel each other. Apply the kernel update and reboot your system to ensure the fix is active.
sudo dnf update kernel kernel-devel && sudo rebootDefensia detects this vulnerability
How to check if you are affected
- Check installed kernel version: uname -r
- Verify if kernel version is between 5.15 and 6.9.9: if [ $(uname -r | cut -d. -f1,2) = '5.15' ] || [ $(uname -r | cut -d. -f1,2) = '6.' ]; then grep -E '^6\.([0-8]\.|9\.[0-9]$)' <<< $(uname -r) && echo 'VULNERABLE'; fi
- Check for eBPF timer usage in loaded programs: bpftool prog list | grep -i timer or cat /sys/kernel/debug/tracing/available_events | grep -i timer
- Verify patch application post-update: uname -r | grep -E '6\.9\.1[0-9]|6\.[1-9][0-9]|[7-9]\.' && echo 'PATCHED' || echo 'NOT PATCHED'
FAQ
What is CVE-2024-41045?
CVE-2024-41045 is a deadlock vulnerability in the Linux kernel's eBPF timer implementation. When two timer callbacks attempt to cancel each other, or when map elements containing timers are freed, the kernel can deadlock because timer cancellation is not properly deferred, leading to potential denial of service.
Is CVE-2024-41045 being actively exploited?
No, CVE-2024-41045 is not currently being actively exploited in the wild according to CISA KEV data, and no public exploit code is available. However, it poses a high risk to systems running eBPF applications due to its CVSS score of 7.8.
What versions of Kernel are affected by CVE-2024-41045?
Linux kernel versions 5.15 through 6.9.9 are vulnerable. Kernel version 6.9.10 and later versions contain the fix.
How do I check if my server is vulnerable to CVE-2024-41045?
Run 'uname -r' to check your kernel version. If the output shows version 5.15 through 6.9.9, your system is vulnerable and requires a kernel update to 6.9.10 or later.
Does Defensia detect CVE-2024-41045?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2024-41045 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-41045. Free for 1 server.
Get started free