🇰🇷 한글 설명
Linux 커널의 nfsd 구성 요소에서 fcache_disposal 구조체가 네트워크 네임스페이스 해제 시 먼저 해제되어 발생하는 Use-After-Free(UAF) 취약점입니다. 이로 인해 글로벌 shrinker나 GC 워커가 해제된 포인터를 참조할 때 시스템 오류나 보안 문제가 발생할 수 있습니다. 이를 해결하기 위해 관련 데이터를 nfsd_net 구조체 내로 인라인화하여 생명 주기를 일치시켰습니다.
💡 쉬운 설명
파일을 정리하는 작업이 끝나기도 전에 정리 도구가 먼저 사라져서 발생하는 오류입니다. 이로 인해 컴퓨터 시스템이 갑자기 멈추거나 해킹에 이용될 수 있는 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nfsd: fix fcache_disposal UAF by inlining dispose state into nfsd_net
nfsd_file_dispose_list_delayed() defers fput() to nfsd service threads
via a per-net freeme queue, preventing the shrinker and GC worker from
bearing the cost of closing files (see ffb402596147). However, the
queue lives in a separately-allocated struct nfsd_fcache_disposal that
is freed by nfsd_free_fcache_disposal_net() during per-net teardown.
The global shrinker, laundrette, and fsnotify callbacks can still be
inside nfsd_file_dispose_list_delayed() dereferencing that pointer,
causing a use-after-free.
Inline the spinlock and freeme list directly into struct nfsd_net (as
fcache_dispose_lock and fcache_dispose_list), eliminating the separately
allocated struct nfsd_fcache_disposal entirely. These fields now have
the same lifetime as the net namespace itself, so there is no dangling
pointer to chase.
nfsd_file_cache_start_net() now just initializes the inline fields and
cannot fail due to allocation. nfsd_file_cache_shutdown_net() drains
the inline list directly instead of freeing a separate struct. The
alloc/free helpers are removed.
📍 영향받는 시스템
Linux Kernel (nfsd 모듈을 사용하는 버전)
⚔️ 공격 벡터
네트워크 네임스페이스를 생성하고 해제하는 과정에서 특정 타이밍을 이용한 메모리 참조 유도
🛡️ 대응 방법
nfsd 관련 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인