CVE-2024-41045

Vulnérabilité élevée dans Linux (Linux)

CVSS 7.8 · Élevée
EPSS 0.3%
Linux•Linux•Versions : 6.9.10, <=*, 6.10, 5.15, 6.6.158, <a6fcd19d7eac1335eb76bc16b6a66b7f574d1d69, <=6.6.*, <5eaa11c500ed07f505f86cec07d5593a71927e26, 0, <5.15, <7aa5a19279c3639ae8b758b63f05d0c616a39fa1, b00628b1c7d595ae5b544e059c27b1f5828314b4, <=6.9.*

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.

Gravité et risque d'exploitation

CVE-2024-41045 obtient un score CVSS de 7.8/10, soit une gravité élevée. Selon le modèle EPSS, la probabilité qu'elle soit exploitée dans les 30 prochains jours est de 0.29 %, ce qui la place devant 19.7 % des CVE référencées.

Que faire ?

  • Vérifiez si Linux (versions 6.9.10, <=*, 6.10, 5.15, 6.6.158, <a6fcd19d7eac1335eb76bc16b6a66b7f574d1d69, <=6.6.*, <5eaa11c500ed07f505f86cec07d5593a71927e26, 0, <5.15, <7aa5a19279c3639ae8b758b63f05d0c616a39fa1, b00628b1c7d595ae5b544e059c27b1f5828314b4, <=6.9.*) est présent sur votre parc.
  • Appliquez le correctif ou la version corrigée indiqués dans les références de l'éditeur.
  • À défaut de correctif, limitez l'exposition (filtrage réseau, désactivation du composant).
  • Automatisez la détection : les agents CVE Heimdall (gratuits, open source) corrèlent l'inventaire de vos serveurs avec la base CVE.

Références