🇰🇷 한글 설명
Linux 커널의 mremap() 함수 호출 시 userfaultfd의 write-protected 상태를 처리하는 과정에서 VMA 플래그와 PTE/PMD 플래그 간의 불일치가 발생하는 취약점입니다. 이로 인해 mprotect(PROT_WRITE) 실행 시 페이지 테이블 플래그 검사에서 경고가 발생할 수 있습니다.
💡 쉬운 설명
메모리 위치를 옮기는 과정에서 보안 설정 정보가 제대로 지워지지 않아 시스템 설정이 꼬이는 문제입니다. 이로 인해 메모리 권한을 변경하려 할 때 시스템이 오류를 일으키거나 경고를 보낼 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm: clear uffd-wp PTE/PMD state on mremap()
When mremap()ing a memory region previously registered with userfaultfd as
write-protected but without UFFD_FEATURE_EVENT_REMAP, an inconsistency in
flag clearing leads to a mismatch between the vma flags (which have
uffd-wp cleared) and the pte/pmd flags (which do not have uffd-wp
cleared). This mismatch causes a subsequent mprotect(PROT_WRITE) to
trigger a warning in page_table_check_pte_flags() due to setting the pte
to writable while uffd-wp is still set.
Fix this by always explicitly clearing the uffd-wp pte/pmd flags on any
such mremap() so that the values are consistent with the existing clearing
of VM_UFFD_WP. Be careful to clear the logical flag regardless of its
physical form; a PTE bit, a swap PTE bit, or a PTE marker. Cover PTE,
huge PMD and hugetlb paths.
📍 영향받는 시스템
userfaultfd(UFFD_FEATURE_EVENT_REMAP 미사용)를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
특정 메모리 매핑 조건(mremap)을 조작하여 커널의 페이지 테이블 상태 불일치를 유도
🛡️ 대응 방법
mremap() 시 uffd-wp PTE/PMD 플래그를 명시적으로 삭제하도록 업데이트된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인