🇰🇷 한글 설명
Linux 커널의 futex/pi 구성 요소에서 exec() 호출 시 발생하는 레이스 컨디션 취약점입니다. 프로세스의 메모리 관리 구조(mm)가 교체되는 과정에서 검증 로직의 허점으로 인해 잘못된 메모리 참조가 발생할 수 있습니다.
💡 쉬운 설명
프로그램이 새로운 프로그램을 실행할 때, 기존 메모리를 정리하고 새 메모리를 준비하는 찰나의 순간에 보안 검사가 제대로 이루어지지 않는 문제입니다. 이 틈을 타서 잘못된 메모리 영역에 접근할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
futex/pi: Plug private futex exec() race
The check for private futexes whether the waiter's mm, which is stored in
the futex_key and copied into the pi_state, is the same as the owner's mm
is not sufficient for exec(). exec() has a gap where the mm check fails to
give the correct answer:
exec()
...
exec_release_mm()
futex_exec_release()
tsk::futex::exit_state = EXITING;
cleanup_robust_list();
1) tsk::futex::exit_state = OK;
...
old_mm = tsk::mm;
2) tsk::mm = ->mm;
Between #1 and #2 the check for the mm is wrong as that mm is about to be
swapped out and eventually freed.
Plug this gap by:
1) Setting tsk::futex::exit_state to FUTEX_STATE_DEAD in
futex_exec_release()
2) Setting tsk::futex::exit_state to FUTEX_STATE_OK after
the mm has been switched.
From a futex point of view the task is dead after it finished the robust
list cleanup up to the point where it sets the state to OK again.
📍 영향받는 시스템
Linux Kernel (futex/pi 관련 기능이 포함된 버전)
⚔️ 공격 벡터
프로세스의 exec() 호출 시점과 futex 상태 변경 시점 사이의 타이밍을 이용한 레이스 컨디션 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 futex_exec_release() 로직을 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 패치된 최신 버전인지 벤더의 보안 공지와 대조합니다.