🔍 CVE-2024-41045

7.8
CVSS Score
HIGH
2024-07-29
2026-10-30 13:17
✅ 완료

🇰🇷 한글 설명

Linux 커널의 BPF 타이머 취소 및 해제 과정에서 발생하는 교착 상태(Deadlock) 및 Use-After-Free(UAF) 취약점입니다. bpf_map_update_elem을 통해 타이머를 포함한 맵 요소를 해제할 때, 타이머 콜백 간의 충돌로 인해 시스템이 멈추거나 메모리 오류가 발생할 수 있습니다.

💡 쉬운 설명

컴퓨터의 핵심 운영체제인 리눅스에서 특정 작업을 예약하는 타이머 기능에 오류가 있어, 시스템이 멈추거나 메모리 관리 오류가 생길 수 있는 문제입니다. 타이머를 취소하는 과정에서 서로 충돌이 일어나 발생하는 현상입니다.

🇺🇸 원문 (English)

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.

📍 영향받는 시스템

Linux Kernel (BPF 타이머 관련 기능이 활성화된 버전)

⚔️ 공격 벡터

BPF 맵 업데이트를 통해 타이머를 포함한 요소를 해제하여 교착 상태 또는 메모리 오류 유도

🛡️ 대응 방법

Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트

🔧 검증 코드

출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인합니다.

Shell / Script
uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

Linux Kernel