🔍 CVE-2025-22090

7.3
CVSS Score
HIGH
2025-04-16
2026-10-15 22:18
✅ 완료

🇰🇷 한글 설명

Linux 커널의 x86 아키텍처에서 fork() 호출 실패 시 VM_PAT 플래그 처리가 잘못되어 발생하는 취약점입니다. 페이지 테이블 복사 중 오류가 발생하면 예약된 리소스를 제대로 해제하지 못하거나 잘못된 메모리 정보를 참조하여 커널 오류를 유발할 수 있습니다.

💡 쉬운 설명

컴퓨터가 새로운 프로세스를 만들려다 실패했을 때, 메모리 관리 정보가 꼬여서 시스템이 충돌하거나 오류가 발생하는 문제입니다. 메모리 예약과 해제 과정이 완벽하게 맞물리지 않아 발생하는 현상입니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: x86/mm/pat: Fix VM_PAT handling when fork() fails in copy_page_range() If track_pfn_copy() fails, we already added the dst VMA to the maple tree. As fork() fails, we'll cleanup the maple tree, and stumble over the dst VMA for which we neither performed any reservation nor copied any page tables. Consequently untrack_pfn() will see VM_PAT and try obtaining the PAT information from the page table -- which fails because the page table was not copied. The easiest fix would be to simply clear the VM_PAT flag of the dst VMA if track_pfn_copy() fails. However, the whole thing is about "simply" clearing the VM_PAT flag is shaky as well: if we passed track_pfn_copy() and performed a reservation, but copying the page tables fails, we'll simply clear the VM_PAT flag, not properly undoing the reservation ... which is also wrong. So let's fix it properly: set the VM_PAT flag only if the reservation succeeded (leaving it clear initially), and undo the reservation if anything goes wrong while copying the page tables: clearing the VM_PAT flag after undoing the reservation. Note that any copied page table entries will get zapped when the VMA will get removed later, after copy_page_range() succeeded; as VM_PAT is not set then, we won't try cleaning VM_PAT up once more and untrack_pfn() will be happy. Note that leaving these page tables in place without a reservation is not a problem, as we are aborting fork(); this process will never run. A reproducer can trigger this usually at the first try: https://gitlab.com/davidhildenbrand/scratchspace/-/raw/main/reproducers/pat_fork.c WARNING: CPU: 26 PID: 11650 at arch/x86/mm/pat/memtype.c:983 get_pat_info+0xf6/0x110 Modules linked in: ... CPU: 26 UID: 0 PID: 11650 Comm: repro3 Not tainted 6.12.0-rc5+ #92 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-2.fc40 04/01/2014 RIP: 0010:get_pat_info+0xf6/0x110 ... Call Trace: <TASK> ... untrack_pfn+0x52/0x110 unmap_single_vma+0xa6/0xe0 unmap_vmas+0x105/0x1f0 exit_mmap+0xf6/0x460 __mmput+0x4b/0x120 copy_process+0x1bf6/0x2aa0 kernel_clone+0xab/0x440 __do_sys_clone+0x66/0x90 do_syscall_64+0x95/0x180 Likely this case was missed in: d155df53f310 ("x86/mm/pat: clear VM_PAT if copy_p4d_range failed") ... and instead of undoing the reservation we simply cleared the VM_PAT flag. Keep the documentation of these functions in include/linux/pgtable.h, one place is more than sufficient -- we should clean that up for the other functions like track_pfn_remap/untrack_pfn separately.

📍 영향받는 시스템

Linux Kernel (x86 architecture, 특히 6.12.0-rc5+ 등 관련 버전)

⚔️ 공격 벡터

특수하게 조작된 fork() 호출을 유도하여 메모리 복사 실패 상황을 만들어 커널 패닉을 유발할 수 있음

🛡️ 대응 방법

Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 VM_PAT 플래그 및 리저베이션 해제 로직을 수정해야 함

🔧 검증 코드

출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인합니다.

Shell / Script
uname -r

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Linux Kernel