🔍 CVE-2024-35809

4.7
CVSS Score
MEDIUM
2024-05-17
2026-10-15 01:17
✅ 완료

🇰🇷 한글 설명

Linux 커널의 PCI/PM 서브시스템에서 rtsx_pci 드라이버의 .runtime_idle() 콜백과 .remove() 콜백 사이에 레이스 컨디션(경쟁 상태)이 발생할 수 있는 취약점입니다. 이로 인해 처리되지 않은 페이지 폴트가 발생하여 커널 크래시(시스템 중단)가 유발될 수 있습니다.

💡 쉬운 설명

장치를 제거하는 과정과 장치를 절전 모드로 전환하는 과정이 동시에 일어나면서 컴퓨터 시스템이 충돌하는 문제입니다. 이 충돌이 발생하면 시스템이 갑자기 멈추거나 재부팅될 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: PCI/PM: Drain runtime-idle callbacks before driver removal A race condition between the .runtime_idle() callback and the .remove() callback in the rtsx_pcr PCI driver leads to a kernel crash due to an unhandled page fault [1]. The problem is that rtsx_pci_runtime_idle() is not expected to be running after pm_runtime_get_sync() has been called, but the latter doesn't really guarantee that. It only guarantees that the suspend and resume callbacks will not be running when it returns. However, if a .runtime_idle() callback is already running when pm_runtime_get_sync() is called, the latter will notice that the runtime PM status of the device is RPM_ACTIVE and it will return right away without waiting for the former to complete. In fact, it cannot wait for .runtime_idle() to complete because it may be called from that callback (it arguably does not make much sense to do that, but it is not strictly prohibited). Thus in general, whoever is providing a .runtime_idle() callback needs to protect it from running in parallel with whatever code runs after pm_runtime_get_sync(). [Note that .runtime_idle() will not start after pm_runtime_get_sync() has returned, but it may continue running then if it has started earlier.] One way to address that race condition is to call pm_runtime_barrier() after pm_runtime_get_sync() (not before it, because a nonzero value of the runtime PM usage counter is necessary to prevent runtime PM callbacks from being invoked) to wait for the .runtime_idle() callback to complete should it be running at that point. A suitable place for doing that is in pci_device_remove() which calls pm_runtime_get_sync() before removing the driver, so it may as well call pm_runtime_barrier() subsequently, which will prevent the race in question from occurring, not just in the rtsx_pcr driver, but in any PCI drivers providing .runtime_idle() callbacks.

📍 영향받는 시스템

rtsx_pci 콜백을 사용하는 PCI 드라이버가 포함된 Linux 커널

⚔️ 공격 벡터

로컬 공격자가 특정 하드웨어 드라이버의 전원 관리 상태를 조작하여 레이스 컨디션을 유발함으로써 시스템을 중단시킬 수 있음

🛡️ 대응 방법

커널 패치를 통해 pci_device_remove() 호출 시 pm_runtime_barrier()를 사용하여 실행 중인 콜백이 완료될 때까지 대기하도록 업데이트해야 함

🔧 검증 코드

출력된 커널 버전이 해당 취약점이 수정된 최신 패치 버전인지 확인하십시오.

Shell / Script
uname -r

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Linux Kernel