🇰🇷 한글 설명
Linux 커널의 mana 네트워크 드라이버에서 DMA 버퍼의 hwc_msg_id를 처리할 때 발생하는 TOCTOU(Time-of-Check to Time-of-Use) 이중 페치 취약점입니다. 하드웨어가 검증 단계와 사용 단계 사이에서 DMA 메모리 값을 변경할 수 있어 경계 검사를 우회할 수 있습니다.
💡 쉬운 설명
데이터를 검사한 직후에 하드웨어가 그 값을 몰래 바꿔치기하여 보안 검사를 무력화할 수 있는 결함입니다. 이로 인해 시스템이 예상치 못한 동작을 하거나 공격자가 조작된 데이터를 처리하게 만들 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: mana: Fix TOCTOU double-fetch of hwc_msg_id from DMA buffer
In mana_hwc_rx_event_handler(), resp->response.hwc_msg_id is read from
DMA-coherent memory and bounds-checked, then mana_hwc_handle_resp()
re-reads the same field from the same DMA buffer for test_bit() and
pointer arithmetic.
DMA-coherent memory is mapped uncacheable on x86 and is shared,
unencrypted, in Confidential VMs (SEV-SNP/TDX), so each load goes
directly to host-visible memory. A H/W can modify the value
between the check and the use, bypassing the bounds validation.
Fix this by reading hwc_msg_id exactly once using READ_ONCE() into a
stack-local variable in mana_hwc_rx_event_handler(), and passing the
validated value as a parameter to mana_hwc_handle_resp().
📍 영향받는 시스템
Linux kernel (mana network driver component)
⚔️ 공격 벡터
악의적인 하드웨어가 DMA 버퍼의 값을 검증 직후에 변경하여 경계 검사를 우회함
🛡️ 대응 방법
READ_ONCE()를 사용하여 값을 로컬 변수에 한 번만 읽어오도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.