🇰🇷 한글 설명
Linux 커널에서 ptrace와 TSYNC를 사용하는 과정 중 seccomp 필터를 우회할 수 있는 레이스 컨디션 취약점이 발견되었습니다. ptrace로 인해 스레드가 중지된 상태에서 다른 스레드가 seccomp 필터를 설치할 경우, 중지된 스레드가 새로운 필터 설정을 인지하지 못해 차단되어야 할 시스템 호출을 실행할 수 있습니다.
💡 쉬운 설명
보안 규칙(seccomp)을 적용하려는 순간, 시스템이 잠시 멈춰있는 틈을 타서 규칙을 무시하고 금지된 명령을 실행할 수 있는 보안 구멍입니다. 공격자는 이 타이밍을 이용해 원래는 막혀 있어야 할 위험한 동작을 수행할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
entry: Fix seccomp bypass after ptrace with TSYNC
Sashiko review pointed out the following issue.
If a thread is stopped in syscall_trace_enter() for ptrace, another
thread can install a seccomp filter with SECCOMP_FILTER_FLAG_TSYNC
(e.g., via seccomp_attach_filter()). This will successfully set
SYSCALL_WORK_SECCOMP on the stopped thread, but syscall_trace_enter()
evaluates a cached 'work' variable sampled on entry. Consequently,
the subsequent check for SYSCALL_WORK_SECCOMP misses the newly
assigned flag, and the filter is silently bypassed.
This race condition could allow an unprivileged process to execute
a prohibited system call (e.g., execve) that the newly installed filter
was intended to block, especially since the tracer might have modified
the system call number during the ptrace stop.
Fix this by re-reading the syscall_work flags after ptrace handling,
so that any new SYSCALL_WORK_SECCOMP flag set by another thread via
TSYNC during the ptrace stop is observed before the subsequent
seccomp check.
📍 영향받는 시스템
TSYNC 플래그를 사용하는 seccomp 및 ptrace 기능을 포함한 Linux 커널
⚔️ 공격 벡터
ptrace로 스레드를 중지시킨 상태에서 다른 스레드를 통해 SECCOMP_FILTER_FLAG_TSYNC를 사용하여 필터를 설치하는 레이스 컨디션 공격
🛡️ 대응 방법
해당 취약점이 수정된 최신 버전의 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 배포판의 보안 업데이트 버전인지 확인