🇰🇷 한글 설명
리눅스 커널의 hugetlb 처리 과정에서 발생하는 Use-After-Free(UAF) 취약점입니다. hugetlb_handle_userfault 함수가 실행되는 동안 vma_lock과 mmap_lock이 해제되었다가 다시 획득되는 과정에서 레이스 컨디션이 발생하여 메모리 오류를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터가 메모리를 관리하는 과정에서 잠시 문을 열어두는 사이에 다른 작업이 메모리 정보를 바꿔버려 발생하는 오류입니다. 이로 인해 시스템이 충돌하거나 해커가 권한을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm: hugetlb: fix UAF in hugetlb_handle_userfault
The vma_lock and hugetlb_fault_mutex are dropped before handling userfault
and reacquire them again after handle_userfault(), but reacquire the
vma_lock could lead to UAF[1,2] due to the following race,
hugetlb_fault
hugetlb_no_page
/*unlock vma_lock */
hugetlb_handle_userfault
handle_userfault
/* unlock mm->mmap_lock*/
vm_mmap_pgoff
do_mmap
mmap_region
munmap_vma_range
/* clean old vma */
/* lock vma_lock again <--- UAF */
/* unlock vma_lock */
Since the vma_lock will unlock immediately after
hugetlb_handle_userfault(), let's drop the unneeded lock and unlock in
hugetlb_handle_userfault() to fix the issue.
[1] https://lore.kernel.org/linux-mm/
[email protected]/
[2] https://lore.kernel.org/linux-mm/
[email protected]/
📍 영향받는 시스템
hugetlb 기능을 사용하는 취약한 버전의 Linux Kernel
⚔️ 공격 벡터
특수하게 조작된 메모리 접근(userfaultfd 등)을 통해 레이스 컨디션을 유발하여 메모리 오류를 일으킴
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인