🇰🇷 한글 설명
Linux 커널의 nfsd 모듈에서 COPY 코드 경로 실행 중 nfsd_file 참조 횟수(refcount)가 누수되는 취약점이 발견되었습니다. kthread_create 호출 실패 시 src 및 dst nfsd_file 객체가 적절히 해제되지 않아 시스템 자원이 고갈될 수 있습니다.
💡 쉬운 설명
리눅스 서버에서 파일을 복사하는 기능을 사용할 때, 작업이 실패하면 메모리 자원이 제대로 반환되지 않고 쌓이는 문제가 있습니다. 이 문제가 반복되면 서버의 메모리가 부족해져 시스템 성능이 떨어지거나 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nfsd: clean up potential nfsd_file refcount leaks in COPY codepath
There are two different flavors of the nfsd4_copy struct. One is
embedded in the compound and is used directly in synchronous copies. The
other is dynamically allocated, refcounted and tracked in the client
struture. For the embedded one, the cleanup just involves releasing any
nfsd_files held on its behalf. For the async one, the cleanup is a bit
more involved, and we need to dequeue it from lists, unhash it, etc.
There is at least one potential refcount leak in this code now. If the
kthread_create call fails, then both the src and dst nfsd_files in the
original nfsd4_copy object are leaked.
The cleanup in this codepath is also sort of weird. In the async copy
case, we'll have up to four nfsd_file references (src and dst for both
flavors of copy structure). They are both put at the end of
nfsd4_do_async_copy, even though the ones held on behalf of the embedded
one outlive that structure.
Change it so that we always clean up the nfsd_file refs held by the
embedded copy structure before nfsd4_copy returns. Rework
cleanup_async_copy to handle both inter and intra copies. Eliminate
nfsd4_cleanup_intra_ssc since it now becomes a no-op.
📍 영향받는 시스템
nfsd 모듈을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
NFS 서버에 특수하게 조작된 COPY 요청을 보내 커널 스레드 생성을 유도하여 자원 누수를 유발
🛡️ 대응 방법
nfsd_file 참조 횟수 누수 문제가 해결된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인