🔍 CVE-2024-42302

7.8
CVSS Score
HIGH
2024-08-17
2026-10-15 01:18
✅ 완료

🇰🇷 한글 설명

Linux 커널의 PCI/DPC(Downstream Port Containment) 처리 중 발생하는 use-after-free 취약점으로, DPC 이벤트 발생 시 동시에 기기가 핫-제거되면 참조가 없는 자식 기기의 struct pci_dev에 접근하여 커널 오프를 유발합니다. v6.3 이후 pci_bridge_wait_for_secondary_bus() 함수가 DPC 핸들러에서도 호출되면서 발생하기 시작했으며, 이는 v5.10+ 안정 커널까지 역이식되었습니다.

💡 쉬운 설명

리눅스 시스템에서 PCIe 포트의 에러 복구 중에 연결된 기기가 동시에 제거되면, 이미 삭제된 기기 정보에 접근하려다 시스템이 꺼질 수 있습니다. 이는 핫플러그 가능한 저장소나 네트워크 카드를 제거할 때 발생할 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: PCI/DPC: Fix use-after-free on concurrent DPC and hot-removal Keith reports a use-after-free when a DPC event occurs concurrently to hot-removal of the same portion of the hierarchy: The dpc_handler() awaits readiness of the secondary bus below the Downstream Port where the DPC event occurred. To do so, it polls the config space of the first child device on the secondary bus. If that child device is concurrently removed, accesses to its struct pci_dev cause the kernel to oops. That's because pci_bridge_wait_for_secondary_bus() neglects to hold a reference on the child device. Before v6.3, the function was only called on resume from system sleep or on runtime resume. Holding a reference wasn't necessary back then because the pciehp IRQ thread could never run concurrently. (On resume from system sleep, IRQs are not enabled until after the resume_noirq phase. And runtime resume is always awaited before a PCI device is removed.) However starting with v6.3, pci_bridge_wait_for_secondary_bus() is also called on a DPC event. Commit 53b54ad074de ("PCI/DPC: Await readiness of secondary bus after reset"), which introduced that, failed to appreciate that pci_bridge_wait_for_secondary_bus() now needs to hold a reference on the child device because dpc_handler() and pciehp may indeed run concurrently. The commit was backported to v5.10+ stable kernels, so that's the oldest one affected. Add the missing reference acquisition. Abridged stack trace: BUG: unable to handle page fault for address: 00000000091400c0 CPU: 15 PID: 2464 Comm: irq/53-pcie-dpc 6.9.0 RIP: pci_bus_read_config_dword+0x17/0x50 pci_dev_wait() pci_bridge_wait_for_secondary_bus() dpc_reset_link() pcie_do_recovery() dpc_handler()

📍 영향받는 시스템

Linux kernel v5.10 ~ v6.10 (특히 v6.3 이후, PCIe DPC 기능 지원 시스템)

⚔️ 공격 벡터

핫플러그 가능한 PCIe 슬롯에서 DPC 에러 발생 시 동시에 기기 제거 (물리적 접근 또는 권한 있는 사용자 필요)

🛡️ 대응 방법

Linux 커널을 최신 패치 버전으로 업데이트하거나 pci_bridge_wait_for_secondary_bus()에 기기 참조 카운팅을 추가한 패치 적용

🔧 검증 코드

커널 버전이 5.10 이상 6.x 범위면 취약한 버전입니다. 출력이 없으면 안전합니다. 추가로 journalctl -xe에서 'use-after-free' 또는 'DPC' 관련 오류 로그 확인 권장

Shell / Script
uname -r | grep -E '^(5\.(1[0-9]|[2-9][0-9])|6\.)'

📊 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