CVE-2024-41045: bpf: Defer work in bpf_timer_cancel_and_free
bpf: Defer work in bpftimercancelandfree
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.12.25-1Fixed in 6.12.27-1 - Upgrade
Upgrade
Linux kernelto a version that resolves this vulnerability.Patch bpf: Defer work in bpf_timer_cancel_and_free - Configuration
Modify bpf_timer_cancel_and_free to defer work to the global workqueue by adding a work_struct alongside rcu_head, so cancellation/freeing avoids deadlock-prone inline behavior.
bpf_timer_cancel_and_free (in Linux kernel BPF hrtimer cancellation path) cancellation/freeing behavior = defer work to the global workqueue using a work_struct alongside rcu_head (work and RCU used at different times) - Configuration
Use hrtimer_try_to_cancel to fix the cancellation/rearming issue, since the timer cannot be enqueued after async_cancel_and_free.
bpf_timer_cancel_and_free (timer re-cancel logic) timer cancellation method = use hrtimer_try_to_cancel - Configuration
Update existing code comments to reflect the new state of affairs: cancellation is deferred to the global workqueue, and after async_cancel_and_free the timer must be reinitialized before it can be armed again.
bpf_timer_cancel_and_free (code comments/documentation) inline documentation = updated to reflect the new deferred-work and reinitialization state
Event History
Frequently Asked Questions
What is the severity of CVE-2024-41045?
CVE-2024-41045 has been classified as a moderate severity vulnerability in the Linux kernel.
How do I fix CVE-2024-41045?
To fix CVE-2024-41045, update your Linux kernel to version 5.10.223-1, 5.10.226-1, 6.12.10-1, or 6.12.11-1.
Which versions of the Linux kernel are affected by CVE-2024-41045?
CVE-2024-41045 affects Linux kernel versions up to and including 6.1.123-1 and 6.1.119-1.
Is CVE-2024-41045 a remote execution vulnerability?
CVE-2024-41045 does not appear to allow for remote code execution but may allow for local privilege escalation.
How can I check if I am vulnerable to CVE-2024-41045?
You can verify if you are vulnerable to CVE-2024-41045 by checking your installed Linux kernel version against the affected versions.