🇰🇷 한글 설명
Linux 커널의 tegra210-quad SPI 드라이버에서 발생하는 레이스 컨디션 취약점입니다. ISR 스레드와 타임아웃 경로 간의 동기화 부족으로 인해 curr_xfer 포인터가 NULL인 상태에서 참조되어 NULL 포인터 역참조가 발생할 수 있습니다.
💡 쉬운 설명
두 개의 작업이 동시에 실행될 때 데이터가 갑자기 사라지는 현상이 발생하여 시스템이 멈추거나 오류가 날 수 있는 문제입니다. 이를 방지하기 위해 데이터가 안전한지 확인하는 잠금 장치를 추가했습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
spi: tegra210-quad: Protect curr_xfer check in IRQ handler
Now that all other accesses to curr_xfer are done under the lock,
protect the curr_xfer NULL check in tegra_qspi_isr_thread() with the
spinlock. Without this protection, the following race can occur:
CPU0 (ISR thread) CPU1 (timeout path)
---------------- -------------------
if (!tqspi->curr_xfer)
// sees non-NULL
spin_lock()
tqspi->curr_xfer = NULL
spin_unlock()
handle_*_xfer()
spin_lock()
t = tqspi->curr_xfer // NULL!
... t->len ... // NULL dereference!
With this patch, all curr_xfer accesses are now properly synchronized.
Although all accesses to curr_xfer are done under the lock, in
tegra_qspi_isr_thread() it checks for NULL, releases the lock and
reacquires it later in handle_cpu_based_xfer()/handle_dma_based_xfer().
There is a potential for an update in between, which could cause a NULL
pointer dereference.
To handle this, add a NULL check inside the handlers after acquiring
the lock. This ensures that if the timeout path has already cleared
curr_xfer, the handler will safely return without dereferencing the
NULL pointer.
📍 영향받는 시스템
Linux kernel (tegra210-quad SPI driver 사용 시스템)
⚔️ 공격 벡터
특정 하드웨어 인터럽트와 타임아웃이 동시에 발생하는 정밀한 타이밍 공격을 통해 발생 가능
🛡️ 대응 방법
커널 패치를 적용하여 ISR 핸들러 내의 curr_xfer 체크 로직에 스핀락(spinlock) 동기화를 적용해야 함
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.