🔍 CVE-2025-38207

5.5
CVSS Score
MEDIUM
2025-07-04
2026-10-21 13:18
✅ 완료

🇰🇷 한글 설명

리눅스 커널의 메모리 관리(mm) 과정에서 VMA 확장 시 uprobe PTE가 덮어씌워지는 취약점이 발견되었습니다. mremap를 사용하는 특정 시나리오에서 uprobe용 익명 페이지가 유실되어 rss-counter 상태가 불일치하는 버그를 유발합니다.

💡 쉬운 설명

컴퓨터의 메모리를 재배치하는 과정에서 특정 감시 도구(uprobe)가 사용하는 데이터가 실수로 지워지거나 엉뚱한 곳에 저장되는 문제입니다. 이로 인해 시스템의 메모리 계산이 틀어지거나 오류가 발생할 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: mm: fix uprobe pte be overwritten when expanding vma Patch series "Fix uprobe pte be overwritten when expanding vma". This patch (of 4): We encountered a BUG alert triggered by Syzkaller as follows: BUG: Bad rss-counter state mm:00000000b4a60fca type:MM_ANONPAGES val:1 And we can reproduce it with the following steps: 1. register uprobe on file at zero offset 2. mmap the file at zero offset: addr1 = mmap(NULL, 2 * 4096, PROT_NONE, MAP_PRIVATE, fd, 0); 3. mremap part of vma1 to new vma2: addr2 = mremap(addr1, 4096, 2 * 4096, MREMAP_MAYMOVE); 4. mremap back to orig addr1: mremap(addr2, 4096, 4096, MREMAP_MAYMOVE | MREMAP_FIXED, addr1); In step 3, the vma1 range [addr1, addr1 + 4096] will be remap to new vma2 with range [addr2, addr2 + 8192], and remap uprobe anon page from the vma1 to vma2, then unmap the vma1 range [addr1, addr1 + 4096]. In step 4, the vma2 range [addr2, addr2 + 4096] will be remap back to the addr range [addr1, addr1 + 4096]. Since the addr range [addr1 + 4096, addr1 + 8192] still maps the file, it will take vma_merge_new_range to expand the range, and then do uprobe_mmap in vma_complete. Since the merged vma pgoff is also zero offset, it will install uprobe anon page to the merged vma. However, the upcomming move_page_tables step, which use set_pte_at to remap the vma2 uprobe pte to the merged vma, will overwrite the newly uprobe pte in the merged vma, and lead that pte to be orphan. Since the uprobe pte will be remapped to the merged vma, we can remove the unnecessary uprobe_mmap upon merged vma. This problem was first found in linux-6.6.y and also exists in the community syzkaller: https://lore.kernel.org/all/[email protected]/T/

📍 영향받는 시스템

Linux kernel 6.6.y 및 관련 버전

⚔️ 공격 벡터

로컬 사용자가 mmap, mremap 시스템 호출을 정교하게 조합하여 메모리 관리 로직의 오류를 유도

🛡️ 대응 방법

리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트

🔧 검증 코드

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

Shell / Script
uname -r

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Linux Kernel