🔍 CVE-2025-40008

0.0
CVSS Score
UNKNOWN
2025-10-20
2026-10-19 21:10
✅ 완료

🇰🇷 한글 설명

Linux 커널의 KMSAN(Kernel Memory Sanitizer)에서 4바이트로 정렬되지 않은 버퍼에 memset()을 호출할 때 섀도우 메모리에 대한 경계 외 접근(Out-of-bounds access)이 발생하는 취약점입니다. 이로 인해 섀도우 메모리의 범위를 벗어난 영역을 읽으려 시도할 경우 페이지 폴트가 발생하며 커널 크래시가 유발될 수 있습니다.

💡 쉬운 설명

메모리의 상태를 감시하는 도구가 데이터를 처리하는 과정에서 계산 실수를 하여, 허용되지 않은 메모리 영역을 건드려 시스템이 멈추는 문제입니다. 특정 조건에서 메모리 주소를 잘못 계산하여 발생하는 오류입니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: kmsan: fix out-of-bounds access to shadow memory Running sha224_kunit on a KMSAN-enabled kernel results in a crash in kmsan_internal_set_shadow_origin(): BUG: unable to handle page fault for address: ffffbc3840291000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 1810067 P4D 1810067 PUD 192d067 PMD 3c17067 PTE 0 Oops: 0000 [#1] SMP NOPTI CPU: 0 UID: 0 PID: 81 Comm: kunit_try_catch Tainted: G N 6.17.0-rc3 #10 PREEMPT(voluntary) Tainted: [N]=TEST Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014 RIP: 0010:kmsan_internal_set_shadow_origin+0x91/0x100 [...] Call Trace: <TASK> __msan_memset+0xee/0x1a0 sha224_final+0x9e/0x350 test_hash_buffer_overruns+0x46f/0x5f0 ? kmsan_get_shadow_origin_ptr+0x46/0xa0 ? __pfx_test_hash_buffer_overruns+0x10/0x10 kunit_try_run_case+0x198/0xa00 This occurs when memset() is called on a buffer that is not 4-byte aligned and extends to the end of a guard page, i.e. the next page is unmapped. The bug is that the loop at the end of kmsan_internal_set_shadow_origin() accesses the wrong shadow memory bytes when the address is not 4-byte aligned. Since each 4 bytes are associated with an origin, it rounds the address and size so that it can access all the origins that contain the buffer. However, when it checks the corresponding shadow bytes for a particular origin, it incorrectly uses the original unrounded shadow address. This results in reads from shadow memory beyond the end of the buffer's shadow memory, which crashes when that memory is not mapped. To fix this, correctly align the shadow address before accessing the 4 shadow bytes corresponding to each origin.

📍 영향받는 시스템

KMSAN이 활성화된 Linux 커널 (특히 6.17.0-rc3 근처 버전)

⚔️ 공격 벡터

KMSAN이 활성화된 환경에서 정렬되지 않은 버퍼를 사용하는 특정 커널 함수 호출을 통한 로컬 DoS(서비스 거부)

🛡️ 대응 방법

KMSAN의 섀도우 메모리 접근 시 주소를 올바르게 정렬하도록 커널 패치를 적용해야 합니다.

🔧 검증 코드

출력된 커널 버전이 취약점이 수정된 최신 버전인지 확인합니다.

Shell / Script
uname -r

💻 영향받는 소프트웨어

Linux Kernel