CVE-2024-26737
Last modified
CVE-2024-26737 is a high-severity vulnerability rated 7.8/10 on the CVSS scale. In the Linux kernel, the following vulnerability has been resolved: bpf: Fix racing between bpf_timer_cancel_and_free and bpf_timer_cancel The following race is possible between bpf_timer_cancel_and_free and bpf_timer_cancel. It will lead a UAF on the timer->timer. bpf_timer_cancel(); spin_lock(); t = timer->time; spin_unlock(); bpf_timer_cancel_and_free(); spin_lock(); t = timer->timer; timer->timer = NULL; spin_unlock(); hrtimer_cancel(&t->timer); kfree(t); /* UAF on t */ hrtimer_cancel(&t->timer); In bpf_timer_cancel_and_free, this patch frees the timer->timer after a rcu grace period. EPSS estimates a 0.24% chance of exploitation in the next 30 days.
Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix racing between bpf_timer_cancel_and_free and bpf_timer_cancel The following race is possible between bpf_timer_cancel_and_free and bpf_timer_cancel. It will lead a UAF on the timer->timer. bpf_timer_cancel(); spin_lock(); t = timer->time; spin_unlock(); bpf_timer_cancel_and_free(); spin_lock(); t = timer->timer; timer->timer = NULL; spin_unlock(); hrtimer_cancel(&t->timer); kfree(t); /* UAF on t */ hrtimer_cancel(&t->timer); In bpf_timer_cancel_and_free, this patch frees the timer->timer after a rcu grace period. This requires a rcu_head addition to the "struct bpf_hrtimer". Another kfree(t) happens in bpf_timer_init, this does not need a kfree_rcu because it is still under the spin_lock and timer->timer has not been visible by others yet. In bpf_timer_cancel, rcu_read_lock() is added because this helper can be used in a non rcu critical section context (e.g. from a sleepable bpf prog). Other timer->timer usages in helpers.c have been audited, bpf_timer_cancel() is the only place where timer->timer is used outside of the spin_lock. Another solution considered is to mark a t->flag in bpf_timer_cancel and clear it after hrtimer_cancel() is done. In bpf_timer_cancel_and_free, it busy waits for the flag to be cleared before kfree(t). This patch goes with a straight forward solution and frees timer->timer after a rcu grace period.
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, < 5.15.150 | — |
| Linux | Linux Kernel | >= 5.16, < 6.1.80 | — |
| Linux | Linux Kernel | >= 6.2, < 6.6.19 | — |
| Linux | Linux Kernel | >= 6.7, < 6.7.7 | — |
| Linux | Linux Kernel | 6.8 | Rc1 |
References
Timeline
- Published
- Last Modified
- Status
- Modified
Frequently Asked Questions
What is CVE-2024-26737?
How severe is CVE-2024-26737?
How do I fix CVE-2024-26737?
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-26731In the Linux kernel, the following vulnerability has been re…5.3
- CVE-2024-26732In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-26733In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-26734In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2024-26735In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-26736In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2024-26738In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-26739In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2024-2674A vulnerability classified as critical was found in Campcode…6.5
- CVE-2024-26740In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-26741In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2024-26742In the Linux kernel, the following vulnerability has been re…7.8
Are you affected by CVE-2024-26737?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
