🇰🇷 한글 설명
리눅스 커널의 SELinux 구현에서 mprotect() 함수가 스택형 파일 시스템의 중간 계층에 대한 보안 검사를 누락하는 취약점이 발견되었습니다. 이로 인해 mmap()을 통한 직접적인 실행 권한 요청은 차단되더라도, mprotect()를 우회하여 중간 레이어의 보안 정책을 무시하고 실행 권한을 획득할 수 있습니다.
💡 쉬운 설명
파일 시스템이 여러 겹으로 쌓여 있을 때, 보안 검사를 건너뛰고 파일에 실행 권한을 부여할 수 있는 허점이 있었습니다. 공격자는 이를 이용해 원래는 실행할 수 없는 파일을 강제로 실행할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
selinux: recheck intermediate backing files on mprotect()
mprotect() can be used to bypass the SELinux checks that mmap() performs
against the intermediate layers of a stacked filesystem.
mmap() checks every backing layer as the request descends through the
stack. mprotect() only has the lowest backing file in vma->vm_file, so it
rechecks the top-level user and the lowest mounter, but skips the mounters
of every layer in between. With two nested overlayfs mounts and a policy
denying mounter_t -> middle_file_t:file { execute }, a direct
mmap(PROT_EXEC) is denied:
avc: denied { execute } for pid=71 comm="nested_exec"
path="/payload" dev="overlay" ino=9
scontext=user_u:base_r:mounter_t
tcontext=user_u:object_r:middle_file_t tclass=file permissive=0
while mmap(PROT_NONE) followed by mprotect(PROT_EXEC) succeeds.
Preserve each intermediate path, mounter SID and file-description SID in
the backing-file security blob, copying the saved entries when another
backing layer is opened. Allocate the array only for nested backing files,
and release it and the path references in the backing_file_free hook.
During mprotect(), recheck fd { use } and the requested inode permissions
for every saved mounter, and include the intermediate layers in the execmod
checks. Policy for nested stacking may then need to grant intermediate
mounters what a direct mmap() already requires, and execmod on intermediate
labels for binaries using text relocations.
Tested on arm64 QEMU with a small BusyBox initramfs and a purpose-built
SELinux policy, on a mainline tree containing
commit f2381b546e7e ("fs: fix user path of nested backing files").
[PM: subject tweak]
📍 영향받는 시스템
중첩된 OverlayFS를 사용하는 리눅스 커널 (arm64 및 기타 아키텍처)
⚔️ 공격 벡터
mmap(PROT_NONE) 호출 후 mprotect(PROT_EXEC)를 사용하여 SELinux의 중간 레이어 검사를 우회
🛡️ 대응 방법
커널 패치(commit f2381b546e7e 포함)를 적용하여 mprotect() 시 모든 중간 계층의 보안 컨텍스트를 재검토하도록 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 보안 패치가 적용된 최신 버전인지 확인하십시오.
💻 영향받는 소프트웨어
NVIDIA Cloud Gaming Guest Driver for Linux