🇰🇷 한글 설명
Linux 커널의 pds_core에서 발생한 취약점으로, 장치 리셋과 펌웨어 업데이트가 동시에 진행될 때 명령 레지스터(cmd_regs)에 대한 접근 경쟁 상태가 발생합니다. 이로 인해 잠금(lock) 없이 MMIO 영역이 해제되어 NULL 역참조 또는 잘못된 메모리 쓰기가 발생할 수 있습니다.
💡 쉬운 설명
하드웨어 장치를 초기화하는 과정과 소프트웨어를 업데이트하는 과정이 동시에 일어날 때, 컴퓨터가 엉뚱한 메모리 주소를 건드려 시스템이 멈추거나 오류가 날 수 있는 문제입니다. 이를 방지하기 위해 작업 순서를 안전하게 제어하도록 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
pds_core: fix cmd_regs access racing BAR unmap on reset
pdsc_reset_prepare() and pdsc_reset_done()'s pdsc_map_bars() error path
clear/iounmap cmd_regs without devcmd_lock, and
pdsc_legacy_firmware_update()'s download loop derefs cmd_regs after
dropping and retaking the lock without re-checking. An FLR concurrent
with a devlink flash can unmap cmd_regs under an in-flight devcmd,
causing a NULL deref or a write to unmapped MMIO.
Take devcmd_lock across the BAR unmap/remap, and re-check cmd_regs in
the download loop. Only the PF maps cmd_regs and runs devcmd, so skip
the unmap on a VF, as pdsc_remove() and pdsc_reset_done() already do.
A reset that completes entirely within the unlocked window is not a
correctness problem for the image: the device clears its update session,
so a resumed download is rejected, and it verifies the staged image
before writing a flash slot, reporting PDS_RC_BAD_FW rather than
activating it.
pdsc_unmap_bars() also clears info_regs, intr_status and intr_ctrl. The
interrupt and start/stop readers of those are quiesced before the unmap
by pdsc_fw_down(), which frees the interrupts and tears down the queues.
The debugfs readers are not, since those files outlive a reset; that is
pre-existing and out of scope here.
📍 영향받는 시스템
Linux kernel (pds_core 모듈을 사용하는 시스템)
⚔️ 공격 벡터
장치 리셋(FLR)과 펌웨어 업데이트(devlink flash)를 동시에 유도하여 경쟁 상태를 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인