🇰🇷 한글 설명
Linux 커널의 binfmt_misc 모듈에서 마운트 실패 시 사용자 네임스페이스(user namespace)를 적절히 해제하지 못해 발생하는 메모리 누수 취약점입니다. 권한이 없는 사용자가 메모리 제한이 엄격한 cgroup 환경에서 의도적으로 마운트 실패를 유도하여 시스템 자원을 고갈시킬 수 있습니다.
💡 쉬운 설명
시스템의 특정 기능을 실행하려다 실패했을 때, 사용했던 메모리 자원을 제대로 돌려주지 않고 계속 붙잡고 있는 버그입니다. 공격자가 이 버그를 반복적으로 이용하면 컴퓨터의 메모리가 부족해져 시스템이 느려지거나 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
binfmt_misc: don't leak the user namespace when the mount fails
bm_get_tree() takes a reference to the user namespace and hands it to
get_tree_keyed() as the sget key. sget_fc() moves that reference into
sb->s_fs_info and clears fc->s_fs_info, so from that point on the
superblock owns it and bm_free() doesn't see it anymore.
The superblock drops it in ->put_super(). But generic_shutdown_super()
only calls ->put_super() from inside the if (sb->s_root) branch, so
nothing releases it when bm_fill_super() fails:
- The kzalloc_obj() failure leaves s_root NULL and the whole branch is
skipped.
- A simple_fill_super() failure in the file loop leaves s_root set, but
s_op still points at simple_super_operations, which has no
->put_super(). bm_fill_super() installs s_ops only once
simple_fill_super() returned success, and installing it earlier
wouldn't help either because simple_fill_super() overwrites s_op.
Either way vfs_get_super() calls deactivate_locked_super() and the
reference is gone for good. binfmt_misc mounts are available in a user
namespace and both the inode and the dentry cache are SLAB_ACCOUNT, so
an unprivileged caller under a tight memory cgroup can fail
simple_fill_super() on demand and leak one user namespace per attempt.
Drop the reference in ->kill_sb() instead, which runs unconditionally,
the same way nfsd and rpc_pipefs release their keyed s_fs_info.
That also stops ->put_super() from clearing s_fs_info while the
superblock is still on @fs_supers. generic_shutdown_super() leaves it
there on purpose so that sget_fc() keeps finding it until kill_sb() has
run, but a NULL s_fs_info makes test_keyed_super() miss it, so a
concurrent mount for the same user namespace skips the grab_super()
wait and creates a second superblock for a namespace that is still
being torn down.
📍 영향받는 시스템
Linux Kernel (binfmt_misc 모듈을 사용하는 모든 버전)
⚔️ 공격 벡터
권한이 없는 사용자가 메모리 제한(cgroup)이 설정된 환경에서 binfmt_misc 마운트를 반복적으로 시도하여 자원 고갈 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 binfmt_misc의 자원 해제 로직 수정 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인
💻 영향받는 소프트웨어
NVIDIA Cloud Gaming Guest Driver for Linux