🔍 CVE-2025-38398

7.8
CVSS Score
HIGH
2025-07-25
2026-07-30 06:23
✅ 완료

🇰🇷 한글 설명

Linux 커널의 spi-qpic-snand 드라이버에서 BAM 트랜잭션 할당 시 발생하는 메모리 손상 취약점입니다. 드라이버가 NAND 칩의 실제 페이지 크기에 따른 필요한 메모리 공간을 충분히 할당하지 않아, 범위를 벗어난 메모리 접근(Out-of-bounds access)이 발생하여 시스템 패닉을 유발할 수 있습니다.

💡 쉬운 설명

데이터를 저장하는 장치(NAND)를 다루는 프로그램이 필요한 것보다 훨씬 적은 메모리 공간만 미리 빌려두어 문제가 발생합니다. 이로 인해 정해진 공간을 넘어서 데이터를 쓰게 되면 컴퓨터 시스템이 갑자기 멈추거나 꺼질 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: spi: spi-qpic-snand: reallocate BAM transactions Using the mtd_nandbiterrs module for testing the driver occasionally results in weird things like below. 1. swiotlb mapping fails with the following message: [ 85.926216] qcom_snand 79b0000.spi: swiotlb buffer is full (sz: 4294967294 bytes), total 512 (slots), used 0 (slots) [ 85.932937] qcom_snand 79b0000.spi: failure in mapping desc [ 87.999314] qcom_snand 79b0000.spi: failure to write raw page [ 87.999352] mtd_nandbiterrs: error: write_oob failed (-110) Rebooting the board after this causes a panic due to a NULL pointer dereference. 2. If the swiotlb mapping does not fail, rebooting the board may result in a different panic due to a bad spinlock magic: [ 256.104459] BUG: spinlock bad magic on CPU#3, procd/2241 [ 256.104488] Unable to handle kernel paging request at virtual address ffffffff0000049b ... Investigating the issue revealed that these symptoms are results of memory corruption which is caused by out of bounds access within the driver. The driver uses a dynamically allocated structure for BAM transactions, which structure must have enough space for all possible variations of different flash operations initiated by the driver. The required space heavily depends on the actual number of 'codewords' which is calculated from the pagesize of the actual NAND chip. Although the qcom_nandc_alloc() function allocates memory for the BAM transactions during probe, but since the actual number of 'codewords' is not yet know the allocation is done for one 'codeword' only. Because of this, whenever the driver does a flash operation, and the number of the required transactions exceeds the size of the allocated arrays the driver accesses memory out of the allocated range. To avoid this, change the code to free the initially allocated BAM transactions memory, and allocate a new one once the actual number of 'codewords' required for a given NAND chip is known.

📍 영향받는 시스템

Linux kernel (spi-qpic-snand driver 포함 버전)

⚔️ 공격 벡터

특정 NAND 칩의 동작을 유도하여 드라이버의 메모리 범위를 초과하는 쓰기 작업을 발생시킴

🛡️ 대응 방법

커널 패치를 적용하여 NAND 칩의 실제 데이터 크기(codewords)를 확인한 후 그에 맞는 메모리를 재할당하도록 업데이트해야 함

🔧 검증 코드

현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.

Shell / Script
uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

Linux Kernel