🔍 CVE-2025-40006

7.8
CVSS Score
HIGH
2025-10-20
2026-10-19 21:10
✅ 완료

🇰🇷 한글 설명

Linux 커널의 mm/hugetlb 구성 요소에서 발생하는 취약점으로, folio 마이그레이션과 fallocate 작업이 동시에 발생할 때 레이스 컨디션이 발생합니다. 이로 인해 folio가 삭제될 때 여전히 매핑된 상태로 남아 있어 커널의 BUG(Bad page cache)를 유발할 수 있습니다.

💡 쉬운 설명

컴퓨터의 메모리를 관리하는 과정에서 두 가지 작업이 동시에 충돌하여 메모리 정보가 꼬이는 문제입니다. 이로 인해 시스템이 오류를 일으키거나 비정상적으로 작동할 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: mm/hugetlb: fix folio is still mapped when deleted Migration may be raced with fallocating hole. remove_inode_single_folio will unmap the folio if the folio is still mapped. However, it's called without folio lock. If the folio is migrated and the mapped pte has been converted to migration entry, folio_mapped() returns false, and won't unmap it. Due to extra refcount held by remove_inode_single_folio, migration fails, restores migration entry to normal pte, and the folio is mapped again. As a result, we triggered BUG in filemap_unaccount_folio. The log is as follows: BUG: Bad page cache in process hugetlb pfn:156c00 page: refcount:515 mapcount:0 mapping:0000000099fef6e1 index:0x0 pfn:0x156c00 head: order:9 mapcount:1 entire_mapcount:1 nr_pages_mapped:0 pincount:0 aops:hugetlbfs_aops ino:dcc dentry name(?):"my_hugepage_file" flags: 0x17ffffc00000c1(locked|waiters|head|node=0|zone=2|lastcpupid=0x1fffff) page_type: f4(hugetlb) page dumped because: still mapped when deleted CPU: 1 UID: 0 PID: 395 Comm: hugetlb Not tainted 6.17.0-rc5-00044-g7aac71907bde-dirty #484 NONE Hardware name: QEMU Ubuntu 24.04 PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015 Call Trace: <TASK> dump_stack_lvl+0x4f/0x70 filemap_unaccount_folio+0xc4/0x1c0 __filemap_remove_folio+0x38/0x1c0 filemap_remove_folio+0x41/0xd0 remove_inode_hugepages+0x142/0x250 hugetlbfs_fallocate+0x471/0x5a0 vfs_fallocate+0x149/0x380 Hold folio lock before checking if the folio is mapped to avold race with migration.

📍 영향받는 시스템

Linux kernel (hugetlb 관련 기능이 활성화된 버전)

⚔️ 공격 벡터

로컬 사용자가 hugetlb와 fallocate 작업을 교묘하게 동시에 실행하여 레이스 컨디션을 유발

🛡️ 대응 방법

folio 마이그레이션과 충돌을 방지하기 위해 folio lock을 사용하는 최신 커널 버전으로 업데이트

🔧 검증 코드

출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인

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