🇰🇷 한글 설명
리눅스 커널의 filelock 구현에서 fcntl과 close 호출 간의 경쟁 상태(race condition)로 인해 발생할 수 있는 취약점입니다. LSM(Linux Security Module)의 차단이나 메모리 할당 실패로 인해 잠금(lock)이 제대로 해제되지 않을 경우, /proc/locks를 읽을 때 Use-After-Free가 발생하여 커널 메모리를 읽을 수 있습니다.
💡 쉬운 설명
파일을 잠그고 해제하는 과정에서 시스템 오류로 인해 잠금이 제대로 풀리지 않는 문제가 있습니다. 이 문제를 이용하면 해커가 컴퓨터의 중요한 내부 정보를 몰래 훔쳐볼 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
filelock: Remove locks reliably when fcntl/close race is detected
When fcntl_setlk() races with close(), it removes the created lock with
do_lock_file_wait().
However, LSMs can allow the first do_lock_file_wait() that created the lock
while denying the second do_lock_file_wait() that tries to remove the lock.
Separately, posix_lock_file() could also fail to
remove a lock due to GFP_KERNEL allocation failure (when splitting a range
in the middle).
After the bug has been triggered, use-after-free reads will occur in
lock_get_status() when userspace reads /proc/locks. This can likely be used
to read arbitrary kernel memory, but can't corrupt kernel memory.
Fix it by calling locks_remove_posix() instead, which is designed to
reliably get rid of POSIX locks associated with the given file and
files_struct and is also used by filp_flush().
📍 영향받는 시스템
Linux Kernel (fcntl/close race condition이 발생하는 버전)
⚔️ 공격 벡터
fcntl/close 경쟁 상태 유도 및 /proc/locks 읽기를 통한 커널 메모리 유출
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 locks_remove_posix()가 적용되도록 합니다.
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 최신 패치 버전인지 배포판 보안 공지를 통해 확인합니다.