🇰🇷 한글 설명
Linux 커널의 xHCI 드라이버에서 컨트롤러가 응답하지 않을 때 잘못된 레지스터 주소를 계산하여 발생하는 취약점입니다. 컨트롤러가 비정상적인 상태일 경우 잘못된 메모리 주소에 접근하게 되어 arm64 아키텍처에서 정렬 오류(alignment fault)로 인한 커널 패닉(Oops)이 발생할 수 있습니다.
💡 쉬운 설명
USB 컨트롤러가 고장 나거나 연결이 끊겼을 때, 컴퓨터가 잘못된 위치의 메모리를 읽으려고 시도하다가 시스템이 멈추는 현상입니다. 하드웨어 오류가 발생했을 때 소프트웨어가 이를 제대로 처리하지 못해 발생하는 문제입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: xhci: bail out of setup if the controller is inaccessible
xhci_gen_setup() locates the operational registers using the capability
length read from the very first register:
xhci->op_regs = hcd->regs +
HC_LENGTH(readl(&xhci->cap_regs->hc_capbase));
If the controller is dead or has dropped off the bus, that read returns
~0, HC_LENGTH() truncates it to 0xff, and op_regs ends up 0xff bytes
past the page-aligned MMIO base, i.e. unaligned. The first access
through it, xhci_halt() -> xhci_handshake() reading op_regs->status, is
then an unaligned readl() on device memory. arm64 faults on unaligned
device accesses, so instead of xhci_handshake() catching the all-ones
value and returning -ENODEV, setup oopses:
xhci-pci-renesas 0005:08:00.0: Unable to change power state from D3cold to D0, device inaccessible
xhci-pci-renesas 0005:08:00.0: xHCI Host Controller
xhci-pci-renesas 0005:08:00.0: new USB bus registered, assigned bus number 1
Unable to handle kernel paging request at virtual address ffff80030a770103
ESR = 0x0000000096000021
FSC = 0x21: alignment fault
Internal error: Oops: 0000000096000021 [#1] SMP
pc : xhci_halt [xhci_hcd]
Call trace:
xhci_halt
xhci_gen_setup
xhci_pci_setup
usb_add_hcd
usb_hcd_pci_probe
xhci_pci_common_probe
xhci_pci_renesas_probe
This was hit with a Renesas uPD720201 that failed to power up ("Unable
to change power state from D3cold to D0, device inaccessible") yet still
reached the HCD probe path.
Read the capability register once, and if it reads back the all-ones
value (as xhci_handshake() and xhci_reset() already test for), abort
setup with -ENODEV before op_regs is derived from it. Reading it once
also avoids re-reading a register that may change under a concurrent
hot-removal.
📍 영향받는 시스템
Linux kernel (xHCI driver, specifically on arm64 architecture)
⚔️ 공격 벡터
물리적 하드웨어 오류 또는 장치 제거를 통한 Denial of Service (DoS)
🛡️ 대응 방법
Linux 커널을 최신 패치가 적용된 버전으로 업데이트하여 xHCI 컨트롤러의 상태 확인 로직을 개선해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.