Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2024-42239— bpf: Fail bpf_timer_cancel when callback is being cancelled

Quick assessment

Affected
Linux Linux
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于 bpf 模块在bpf_timer_cancel调用时,如果回调正在被取消,可能会导致死锁。

AI Predicted 5.9 Difficulty: Moderate EPSS 0.17% · P5

Affected Version Matrix 8

VendorProduct Version RangeStatus
Linux Linux b00628b1c7d595ae5b544e059c27b1f5828314b4< 9369830518688ecd5b08ffc08ab3302ce2b5d0f7 affected
b00628b1c7d595ae5b544e059c27b1f5828314b4< 3e4e8178a8666c56813bd167b848fca0f4c9af0a affected
b00628b1c7d595ae5b544e059c27b1f5828314b4< d4523831f07a267a943f0dde844bf8ead7495f13 affected
5.15 affected
< 5.15 unaffected
6.6.41≤ 6.6.* unaffected
6.9.10≤ 6.9.* unaffected
6.10≤ * unaffected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2024-42239

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
bpf: Fail bpf_timer_cancel when callback is being cancelled
Source: CVE Program / CVE List V5
Vulnerability Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Fail bpf_timer_cancel when callback is being cancelled Given a schedule: timer1 cb timer2 cb bpf_timer_cancel(timer2); bpf_timer_cancel(timer1); Both bpf_timer_cancel calls would wait for the other callback to finish executing, introducing a lockup. Add an atomic_t count named 'cancelling' in bpf_hrtimer. This keeps track of all in-flight cancellation requests for a given BPF timer. Whenever cancelling a BPF timer, we must check if we have outstanding cancellation requests, and if so, we must fail the operation with an error (-EDEADLK) since cancellation is synchronous and waits for the callback to finish executing. This implies that we can enter a deadlock situation involving two or more timer callbacks executing in parallel and attempting to cancel one another. Note that we avoid incrementing the cancelling counter for the target timer (the one being cancelled) if bpf_timer_cancel is not invoked from a callback, to avoid spurious errors. The whole point of detecting cur->cancelling and returning -EDEADLK is to not enter a busy wait loop (which may or may not lead to a lockup). This does not apply in case the caller is in a non-callback context, the other side can continue to cancel as it sees fit without running into errors. Background on prior attempts: Earlier versions of this patch used a bool 'cancelling' bit and used the following pattern under timer->lock to publish cancellation status. lock(t->lock); t->cancelling = true; mb(); if (cur->cancelling) return -EDEADLK; unlock(t->lock); hrtimer_cancel(t->timer); t->cancelling = false; The store outside the critical section could overwrite a parallel requests t->cancelling assignment to true, to ensure the parallely executing callback observes its cancellation status. It would be necessary to clear this cancelling bit once hrtimer_cancel is done, but lack of serialization introduced races. Another option was explored where bpf_timer_start would clear the bit when (re)starting the timer under timer->lock. This would ensure serialized access to the cancelling bit, but may allow it to be cleared before in-flight hrtimer_cancel has finished executing, such that lockups can occur again. Thus, we choose an atomic counter to keep track of all outstanding cancellation requests and use it to prevent lockups in case callbacks attempt to cancel each other while executing in parallel.
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于 bpf 模块在bpf_timer_cancel调用时,如果回调正在被取消,可能会导致死锁。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
Linux Linux b00628b1c7d595ae5b544e059c27b1f5828314b4 ~ 9369830518688ecd5b08ffc08ab3302ce2b5d0f7 -
Linux Linux 5.15 -

II. Public POCs for CVE-2024-42239

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2024-42239

请登录查看更多情报信息。

Patches & Fixes for CVE-2024-42239 (3)

Same Patch Batch · Linux · 2024-08-07 · 19 CVEs total

CVE-2024-42232 9.8 CRITICAL libceph: fix race between delayed_work() and ceph_monc_stop()
CVE-2024-42249 7.8 HIGH spi: don't unoptimize message in spi_async()
CVE-2024-42234 7.8 HIGH mm: fix crashes from deferred split racing folio migration
CVE-2024-42233 7.8 HIGH filemap: replace pte_offset_map() with pte_offset_map_nolock()
CVE-2024-42235 7.8 HIGH s390/mm: Add NULL pointer check to crst_table_free() base_crst_free()
CVE-2024-42236 7.8 HIGH usb: gadget: configfs: Prevent OOB read/write in usb_string_copy()
CVE-2024-42250 7.8 HIGH cachefiles: add missing lock protection when polling
CVE-2024-42247 7.5 HIGH wireguard: allowedips: avoid unaligned 64-bit memory accesses
CVE-2024-42242 mmc: sdhci: Fix max_seg_size for 64KiB PAGE_SIZE
CVE-2024-42237 firmware: cs_dsp: Validate payload length before processing block
CVE-2024-42238 firmware: cs_dsp: Return error if block header overflows file
CVE-2024-42240 x86/bhi: Avoid warning in #DB handler due to BHI mitigation
CVE-2024-42241 mm/shmem: disable PMD-sized page cache if needed
CVE-2024-42244 USB: serial: mos7840: fix crash on resume
CVE-2024-42243 mm/filemap: make MAX_PAGECACHE_ORDER acceptable to xarray
CVE-2024-42245 Revert "sched/fair: Make sure to try to detach at least one movable task"
CVE-2024-42246 net, sunrpc: Remap EPERM in case of connection failure in xs_tcp_setup_socket
CVE-2024-42248 tty: serial: ma35d1: Add a NULL check for of_node

IV. Related Vulnerabilities

V. Comments for CVE-2024-42239

No comments yet


Leave a comment