5.5
MEDIUM
CVE-2024-26737
Linux Kernel BPF Hrtimer Use-After-Free
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.

INFO

Published Date :

April 3, 2024, 5:15 p.m.

Last Modified :

April 4, 2025, 2:34 p.m.

Source :

416baaa9-dc9f-4396-8d5f-8c081fb06d67

Remotely Exploitable :

No

Impact Score :

3.6

Exploitability Score :

1.8
Affected Products

The following products are affected by CVE-2024-26737 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Linux linux_kernel

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2024-26737 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2024-26737 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • Initial Analysis by [email protected]

    Apr. 04, 2025

    Action Type Old Value New Value
    Added CWE CWE-416
    Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:6.8:rc1:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.16 up to (excluding) 6.1.80 *cpe:2.3:o:linux:linux_kernel:6.8:rc3:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.8:rc4:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.8:rc2:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.8:rc5:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.15 up to (excluding) 5.15.150 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.2 up to (excluding) 6.6.19 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.7 up to (excluding) 6.7.7
    Added Reference Type CVE: https://git.kernel.org/stable/c/0281b919e175bb9c3128bd3872ac2903e9436e3f Types: Patch
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/0281b919e175bb9c3128bd3872ac2903e9436e3f Types: Patch
    Added Reference Type CVE: https://git.kernel.org/stable/c/5268bb02107b9eedfdcd51db75b407d10043368c Types: Patch
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/5268bb02107b9eedfdcd51db75b407d10043368c Types: Patch
    Added Reference Type CVE: https://git.kernel.org/stable/c/7d80a9e745fa5b47da3bca001f186c02485c7c33 Types: Patch
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/7d80a9e745fa5b47da3bca001f186c02485c7c33 Types: Patch
    Added Reference Type CVE: https://git.kernel.org/stable/c/8327ed12e8ebc5436bfaa1786c49988894f9c8a6 Types: Patch
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/8327ed12e8ebc5436bfaa1786c49988894f9c8a6 Types: Patch
    Added Reference Type CVE: https://git.kernel.org/stable/c/addf5e297e6cbf5341f9c07720693ca9ba0057b5 Types: Patch
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/addf5e297e6cbf5341f9c07720693ca9ba0057b5 Types: Patch
  • CVE Modified by af854a3a-2127-422b-91ae-364da2661108

    Nov. 21, 2024

    Action Type Old Value New Value
    Added Reference https://git.kernel.org/stable/c/0281b919e175bb9c3128bd3872ac2903e9436e3f
    Added Reference https://git.kernel.org/stable/c/5268bb02107b9eedfdcd51db75b407d10043368c
    Added Reference https://git.kernel.org/stable/c/7d80a9e745fa5b47da3bca001f186c02485c7c33
    Added Reference https://git.kernel.org/stable/c/8327ed12e8ebc5436bfaa1786c49988894f9c8a6
    Added Reference https://git.kernel.org/stable/c/addf5e297e6cbf5341f9c07720693ca9ba0057b5
  • CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0

    Nov. 04, 2024

    Action Type Old Value New Value
    Added CVSS V3.1 CISA-ADP AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
  • CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    May. 29, 2024

    Action Type Old Value New Value
  • CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    May. 14, 2024

    Action Type Old Value New Value
  • CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Apr. 03, 2024

    Action Type Old Value New Value
    Added 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.
    Added Reference kernel.org https://git.kernel.org/stable/c/5268bb02107b9eedfdcd51db75b407d10043368c [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/addf5e297e6cbf5341f9c07720693ca9ba0057b5 [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/8327ed12e8ebc5436bfaa1786c49988894f9c8a6 [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/7d80a9e745fa5b47da3bca001f186c02485c7c33 [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/0281b919e175bb9c3128bd3872ac2903e9436e3f [No types assigned]
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2024-26737 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2024-26737 weaknesses.

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability
© cvefeed.io
Latest DB Update: Jul. 14, 2025 10:20