🇰🇷 한글 설명
Linux 커널의 binfmt_misc 구성 요소에서 인터프리터가 성공적으로 열리기 전에 실행 파일 디스크립터 플래그(have_execfd)가 설정되는 취약점입니다. 인터프리터 오픈 실패 시 잘못된 플래그 상태로 인해 NULL 포인터 역참조가 발생하여 시스템 커널 패닉(Crash)을 유발할 수 있습니다.
💡 쉬운 설명
특정 파일을 실행할 때 필요한 도구를 불러오는 과정에서 오류를 인위적으로 일으켜 컴퓨터 시스템을 강제로 멈추게 할 수 있는 결함입니다. 일반 사용자도 특수한 환경을 만들어 이 오류를 유도할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
binfmt_misc: set have_execfd only once the interpreter is opened
load_misc_binary() raises bprm->have_execfd as soon as it sees the 'O'
(or 'C') flag. This happens well before it opens the interpreter. If
that open fails the flag stays set on the bprm. binfmt_misc is at the
head of the format list so an interpreter open failure that returns
-ENOEXEC lets the search fall through to a later format. This means it
runs the matched binary directly having never staged an interpreter. So
bprm->executable is NULL while have_execfd falsely claims a descriptor
is present.
Consequently, begin_new_exec() dereferences the missing executable:
would_dump(bprm, bprm->executable);
and NULL derefs. Had it not, the hand-off later in the same function
would have failed anyway. FD_ADD(0, bprm->executable) rejects a NULL
file with -ENOMEM. Both sites are past the point of no return so the
exec cannot be unwound either way.
This can be reached by unprivileged users as binfmt_misc can be mounted
in user namespaces. So a user can register an 'O' entry whose
interpreter lives on a FUSE mount, have the FUSE server fail the open
with -ENOEXEC and execute a native ELF file that matches the entry.
have_execfd only means anything alongside the executable it describes
which is not set until the interpreter has been opened and staged.
So lets raise it there, next to execfd_creds, which is already set at
that point. An open failure now leaves it clear, so the fallback format
derives credentials from the binary and emits no AT_EXECFD, as it would
for any native exec. The argv rewrite load_misc_binary() performs before
the open is still not undone. This means the binary sees the interpreter
path in argv[0] and its own path in argv[1] but that predates this
change and only became observable once the exec stopped faulting.
📍 영향받는 시스템
binfmt_misc를 사용하는 Linux 커널 (user namespace가 활성화된 환경)
⚔️ 공격 벡터
사용자 네임스페이스를 통해 binfmt_misc를 마운트한 후, FUSE 마운트된 인터프리터의 오픈을 의도적으로 실패시켜 커널 NULL 역참조 유도
🛡️ 대응 방법
해당 취약점이 수정된 최신 버전의 Linux 커널로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 배포판의 보안 업데이트 버전인지 확인하십시오.
💻 영향받는 소프트웨어
NVIDIA vGPU Guest Driver for Linux