🇰🇷 한글 설명
리눅스 커널의 PCI 드라이버에서 PCIe 링크 재훈련 실패 시 이전 링크 속도를 계산하는 과정에 오류가 있습니다. Link Control 2 레지스터에서 속도 관련 비트 외의 값을 마스킹하지 않아 잘못된 속도 값이 계산되고, 이로 인해 커널 경고(WARN splat)가 발생합니다.
💡 쉬운 설명
컴퓨터 부품 간의 연결 속도를 조절하다가 오류가 났을 때, 원래 속도로 되돌리려다 계산 실수로 인해 시스템에 경고 메시지를 띄우는 문제입니다. 이로 인해 시스템 로그에 오류가 기록될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
PCI: Fix link speed calculation on retrain failure
When pcie_failed_link_retrain() fails to retrain, it tries to revert to the
previous link speed. However it calculates that speed from the Link
Control 2 register without masking out non-speed bits first.
PCIE_LNKCTL2_TLS2SPEED() converts such incorrect values to
PCI_SPEED_UNKNOWN (0xff), which in turn causes a WARN splat in
pcie_set_target_speed():
pci 0000:00:01.1: [1022:14ed] type 01 class 0x060400 PCIe Root Port
pci 0000:00:01.1: broken device, retraining non-functional downstream link at 2.5GT/s
pci 0000:00:01.1: retraining failed
WARNING: CPU: 1 PID: 1 at drivers/pci/pcie/bwctrl.c:168 pcie_set_target_speed
RDX: 0000000000000001 RSI: 00000000000000ff RDI: ffff9acd82efa000
pcie_failed_link_retrain
pci_device_add
pci_scan_single_device
Mask out the non-speed bits in PCIE_LNKCTL2_TLS2SPEED() and
PCIE_LNKCAP_SLS2SPEED() so they don't incorrectly return PCI_SPEED_UNKNOWN.
[bhelgaas: commit log, add details from https://lore.kernel.org/r/1c92ef6bcb314ee6977839b46b393282e4f52e74.1750684771.git.lukas@wunner.de]
📍 영향받는 시스템
PCIe 링크 재훈련 로직이 포함된 Linux Kernel 버전
⚔️ 공격 벡터
물리적 또는 소프트웨어적 PCIe 링크 재훈련 실패 유도 (로컬/물리적 접근 필요)
🛡️ 대응 방법
PCIE_LNKCTL2_TLS2SPEED() 및 PCIE_LNKCAP_SLS2SPEED() 매크로에 비트 마스킹을 적용한 최신 커널로 업데이트
🔧 검증 코드
명령어 실행 결과로 'pcie_set_target_speed' 관련 WARNING이나 'retraining failed' 메시지가 출력되면 취약한 상태입니다.
dmesg | grep -E 'pcie_set_target_speed|retraining failed'