🇰🇷 한글 설명
Linux 커널의 futex 구현에서 exec() 호출 시 발생하는 레이스 컨디션 취약점입니다. 프로세스가 권한이 낮은 상태에서 setuid를 통해 권한이 상승하는 과정 중, ptrace 권한 검사와 실제 데이터 접근 사이에 시간차가 발생하여 민감한 메모리 주소가 유출될 수 있습니다.
💡 쉬운 설명
프로그램이 권한을 얻기 직전의 찰나를 이용해, 보안 검사를 통과한 뒤 권한이 바뀐 프로그램의 중요한 정보를 몰래 훔쳐보는 공격입니다. 이로 인해 시스템의 중요한 메모리 주소가 공격자에게 노출될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
futex: Don't leak robust_list pointer on exec race
sys_get_robust_list() and compat_get_robust_list() use ptrace_may_access()
to check if the calling task is allowed to access another task's
robust_list pointer. This check is racy against a concurrent exec() in the
target process.
During exec(), a task may transition from a non-privileged binary to a
privileged one (e.g., setuid binary) and its credentials/memory mappings
may change. If get_robust_list() performs ptrace_may_access() before
this transition, it may erroneously allow access to sensitive information
after the target becomes privileged.
A racy access allows an attacker to exploit a window during which
ptrace_may_access() passes before a target process transitions to a
privileged state via exec().
For example, consider a non-privileged task T that is about to execute a
setuid-root binary. An attacker task A calls get_robust_list(T) while T
is still unprivileged. Since ptrace_may_access() checks permissions
based on current credentials, it succeeds. However, if T begins exec
immediately afterwards, it becomes privileged and may change its memory
mappings. Because get_robust_list() proceeds to access T->robust_list
without synchronizing with exec() it may read user-space pointers from a
now-privileged process.
This violates the intended post-exec access restrictions and could
expose sensitive memory addresses or be used as a primitive in a larger
exploit chain. Consequently, the race can lead to unauthorized
disclosure of information across privilege boundaries and poses a
potential security risk.
Take a read lock on signal->exec_update_lock prior to invoking
ptrace_may_access() and accessing the robust_list/compat_robust_list.
This ensures that the target task's exec state remains stable during the
check, allowing for consistent and synchronized validation of
credentials.
📍 영향받는 시스템
Linux Kernel (exec()와 robust_list를 사용하는 시스템)
⚔️ 공격 벡터
대상 프로세스가 exec()를 통해 권한을 상승하는 시점에 맞춰 get_robust_list()를 호출하는 레이스 컨디션 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 exec_update_lock 동기화 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인하십시오.