🇰🇷 한글 설명
Linux 커널의 ARM 아키텍처에서 CONFIG_DEBUG_USER 설정 시 show_pte() 함수가 잠금 없이 호출되어 Use-After-Free 취약점이 발생할 수 있습니다. 특정 조건에서 munmap()이 동시에 실행되면 페이지 테이블이 해제되어 커널 패닉을 유발할 수 있습니다.
💡 쉬운 설명
시스템의 디버깅 기능이 켜져 있을 때, 메모리 정보를 읽는 과정과 메모리를 해제하는 과정이 충돌하여 컴퓨터가 갑자기 멈추거나 꺼질 수 있는 문제입니다. 메모리 관리 규칙을 어겨서 발생하는 오류입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ARM: 9485/1: mm: acquire mmap write lock around show_pte() for user faults
When CONFIG_DEBUG_USER=y, and cmdline "user_debug=31" is set,
a user fault may trigger show_pte() without any lock.
If another thread in the same process concurrently calls munmap(),
the page table pages may be freed while show_pte() is still traversing
them, causing a use-after-free in show_pte().
If CONFIG_ARM_LPAE=y, this may cause a kernel panic if the pages table
of PMD are freed when show_pte() is running.
Acquire mmap_write_lock() around show_pte() for user faults to fix the
contention.
For user faults, additionally restrict that show_pte() is called only
when the addr is a user-space address (addr < TASK_SIZE). This is because
the lock of tsk->mm only protects the virtual memory of user address space,
furthermore, dumping the page tables of a kernel-space address for user
faults is unnecessary and may have security implications.
Keep everything unchanged for kernel faults, because the kernel is
already in the "oops" state, acquiring a lock may risk a deadlock.
📍 영향받는 시스템
Linux Kernel (ARM architecture, CONFIG_DEBUG_USER=y, CONFIG_ARM_LPAE=y 설정 시)
⚔️ 공격 벡터
동일한 프로세스 내에서 한 스레드가 메모리 정보를 요청하는 동시에 다른 스레드가 메모리 해제(munmap)를 시도하는 경쟁 상태(Race Condition) 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 show_pte() 호출 시 mmap_write_lock()이 적용되도록 수정해야 합니다.
🔧 검증 코드
커널 버전과 함께 CONFIG_DEBUG_USER 및 CONFIG_ARM_LPAE 설정이 'y'로 되어 있는지 확인하여 취약 조건 충족 여부를 판단합니다.
uname -a && grep -E 'CONFIG_DEBUG_USER|CONFIG_ARM_LPAE' /boot/config-$(uname -r) 2>/dev/null