🇰🇷 한글 설명
Linux 커널의 airoha NPU 드라이버에서 DMA 방향 설정 오류로 인해 데이터 무결성 문제가 발생합니다. NPU가 버퍼에 응답을 기록할 때 CPU 캐시가 적절히 무효화되지 않아, CPU가 NPU의 최신 데이터 대신 오래된(stale) 데이터를 읽게 되는 현상이 발생합니다.
💡 쉬운 설명
기계(NPU)가 메모리에 새로운 정보를 적어두었는데, 컴퓨터(CPU)가 예전에 읽었던 낡은 정보를 그대로 믿고 사용하는 오류입니다. 이로 인해 데이터가 실제와 다르게 처리되는 데이터 오염 현상이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: airoha: Fix DMA direction for NPU mailbox buffer
airoha_npu_send_msg() always maps the mailbox buffer with DMA_TO_DEVICE,
but some callers expect the NPU to write response data back into the
same buffer:
- airoha_npu_wlan_msg_get() (NPU_OP_GET): NPU writes response into
the buffer, then the caller reads it via memcpy()
- airoha_npu_ppe_stats_setup() (NPU_OP_SET): NPU writes back
npu_stats_addr field in the response
On non-cache-coherent architectures like EN7581 (Cortex-A53 without
hardware cache coherency for NPU DMA), DMA_TO_DEVICE unmap is a no-op
— it does not invalidate the CPU cache. If the NPU-written cache line
is still present in the CPU cache when the caller reads the buffer,
the CPU observes stale data instead of the NPU response.
This is a timing-sensitive bug: small mailbox buffers (~24 bytes)
typically fit in a single cache line and may survive in the cache
until the caller reads them, producing silent data corruption rather
than a crash. The bug is more likely to trigger when the caller reads
the response immediately after dma_unmap_single() without intervening
cache-evicting operations.
Fix by using DMA_BIDIRECTIONAL for both map and unmap, which ensures
dma_unmap_single() invalidates the CPU cache on non-coherent systems.
The mailbox buffers are small so there is no performance concern.
📍 영향받는 시스템
Linux kernel (airoha NPU driver components)
⚔️ 공격 벡터
직접적인 공격보다는 특정 타이밍에 데이터가 오염되는 로직 결함이며, 시스템의 신뢰성을 떨어뜨리는 데이터 무결성 위협입니다.
🛡️ 대응 방법
DMA 매핑 방향을 DMA_TO_DEVICE에서 DMA_BIDIRECTIONAL로 변경하여 CPU 캐시 무효화를 보장해야 합니다.
🔧 검증 코드
커널 버전을 확인하여 해당 취약점이 수정된 패치가 적용된 최신 커널 버전인지 확인합니다.
📊 CVSS Vector String
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
💻 영향받는 소프트웨어
NVIDIA vGPU Guest Driver for Linux