🇰🇷 한글 설명
Linux 커널 arm64 아키텍처에서 seccomp와 ptrace 간의 동기화 오류로 인해 시스템 호출 인자 값이 일치하지 않는 취약점이 발견되었습니다. tracer가 x0 레지스터를 변경하더라도 seccomp나 감사(audit) 시스템이 참조하는 orig_x0 값이 업데이트되지 않아 보안 검사를 우회할 수 있습니다.
💡 쉬운 설명
해커가 시스템에 명령을 내릴 때, 보안 프로그램이 검사하는 값과 실제로 실행되는 값이 서로 달라지는 문제가 있습니다. 이를 통해 보안 규칙을 교묘하게 속이고 허용되지 않은 동작을 수행할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
arm64: syscall: Ensure saved x0 is kept in-sync with tracer updates
When seccomp support was originally added to arm64 in a1ae65b21941
("arm64: add seccomp support"), seccomp was erroneously called _before_
the ptrace syscall-enter-stop and therefore the tracer could trivially
manipulate the syscall register state after the seccomp check had
passed. This was subsequently fixed in a5cd110cb836 ("arm64/ptrace: run
seccomp after ptrace") by moving the seccomp check after the tracer has
run. Unfortunately, a decade later, that fix has been reported to be
incomplete.
On arm64, both the first argument to a syscall and its eventual return
value are allocated to register x0. In order to facilitate syscall
restarting and querying of syscall arguments on the syscall exit path,
the original value of x0 is stashed in 'struct pt_regs::orig_x0' early
during the syscall entry path and is returned for the first argument by
syscall_get_arguments(). Unlike 32-bit Arm, this stashed value is not
directly exposed via ptrace() and so changes to register x0 made by the
tracer on a syscall-enter-stop are not reflected in 'orig_x0'. This
means that seccomp, syscall tracepoints and audit can observe a stale
value for the register compared to the argument that will be observed by
the actual syscall.
Re-sync 'orig_x0' from x0 on the syscall entry path following a
potential ptrace stop (i.e. PTRACE_EVENTMSG_SYSCALL_ENTRY or
SECCOMP_RET_TRACE). This behaviour is limited to native tasks (because
compat tasks expose 'orig_r0' to ptrace) where the syscall is not being
skipped (because x0 is updated to hold the return value of -ENOSYS in
that case).
📍 영향받는 시스템
arm64 아키텍처를 사용하는 Linux 커널 (seccomp 및 ptrace 사용 환경)
⚔️ 공격 벡터
ptrace를 사용하여 syscall-enter-stop 시점에 x0 레지스터를 조작하여 seccomp 검사를 우회함
🛡️ 대응 방법
커널 패치를 통해 syscall 진입 경로에서 ptrace 중단 후 orig_x0를 x0와 동기화하도록 업데이트
🔧 검증 코드
현재 사용 중인 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인합니다.
uname -a && grep -E 'Linux version' /proc/version
💻 영향받는 소프트웨어
NVIDIA vGPU Guest Driver for Linux