🇰🇷 한글 설명
Linux 커널의 mm/vma 구성 요소에서 mmap() 호출 중 mmap_prepare()가 실행될 때, 아직 완전히 설정되지 않은 VMA를 해제하려고 시도하여 발생하는 취약점입니다. 이로 인해 vma_mark_detached()에서 경고가 발생하거나 시스템 불안정을 초래할 수 있습니다. 패치를 통해 mmap_prepare()가 호환성 계층을 통해 호출되는 경우 불필요한 VMA 정리 작업을 수행하지 않도록 수정되었습니다.
💡 쉬운 설명
컴퓨터 메모리를 관리하는 과정에서, 아직 준비가 덜 된 메모리 영역을 강제로 삭제하려고 시도하여 오류가 발생하는 문제입니다. 이 문제는 시스템에 경고를 띄우거나 예기치 않은 동작을 일으킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm/vma: do not try to unmap a VMA if mmap_prepare() invoked from mmap()
The mmap_prepare hook functionality includes the ability to invoke
mmap_prepare() from the mmap() hook of existing 'stacked' drivers, that is
ones which are capable of calling the mmap hooks of other drivers/file
systems (e.g. overlayfs, shm).
As part of the mmap_prepare action functionality, we deal with errors by
unmapping the VMA should one arise. This works in the usual mmap_prepare
case, as we invoke this action at the last moment, when the VMA is
established in the maple tree.
However, the mmap() hook passes a not-fully-established VMA pointer to the
caller (which is the motivation behind the mmap_prepare() work), which is
detached.
So attempting to unmap a VMA in this state will be problematic, with the
most obvious symptom being a warning in vma_mark_detached(), because the
VMA is already detached.
It's also unncessary - the mmap() handler will clean up the VMA on error.
So to fix this issue, this patch propagates whether or not an mmap action
is being completed via the compatibility layer or directly.
If the former, then we do not attempt VMA cleanup, if the latter, then we
do.
This patch also updates the userland VMA tests to reflect the change.
📍 영향받는 시스템
mmap_prepare() 기능을 사용하는 'stacked' 드라이버(overlayfs, shm 등)가 포함된 Linux 커널
⚔️ 공격 벡터
특수하게 조작된 mmap() 호출을 통해 커널의 메모리 관리 로직에서 오류를 유도
🛡️ 대응 방법
해당 취약점이 해결된 최신 Linux 커널 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인