🇰🇷 한글 설명
Linux 커널의 nfsd 구성 요소에서 nfsd_nl_threads_set_doit() 함수 호출 시 struct cred 참조 횟수가 적절히 감소하지 않아 메모리 누수가 발생하는 취약점입니다. get_current_cred()로 가져온 참조 권한이 적절히 해제되지 않아 시스템 메모리가 지속적으로 소모될 수 있습니다.
💡 쉬운 설명
리눅스 서버의 파일 공유 기능(NFS)을 사용할 때, 시스템이 사용자의 권한 정보를 메모리에 기록한 후 이를 제대로 지우지 못하는 문제입니다. 이 문제가 반복되면 서버의 메모리가 점차 부족해져 시스템 성능이 떨어지거나 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit().
syzbot reported memory leak of struct cred. [0]
nfsd_nl_threads_set_doit() passes get_current_cred() to
nfsd_svc(), but put_cred() is not called after that.
The cred is finally passed down to _svc_xprt_create(),
which calls get_cred() with the cred for struct svc_xprt.
The ownership of the refcount by get_current_cred() is not
transferred to anywhere and is just leaked.
nfsd_svc() is also called from write_threads(), but it does
not bump file->f_cred there.
nfsd_nl_threads_set_doit() is called from sendmsg() and
current->cred does not go away.
Let's use current_cred() in nfsd_nl_threads_set_doit().
[0]:
BUG: memory leak
unreferenced object 0xffff888108b89480 (size 184):
comm "syz-executor", pid 5994, jiffies 4294943386
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 369454a7):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4958 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
kmem_cache_alloc_noprof+0x412/0x580 mm/slub.c:5270
prepare_creds+0x22/0x600 kernel/cred.c:185
copy_creds+0x44/0x290 kernel/cred.c:286
copy_process+0x7a7/0x2870 kernel/fork.c:2086
kernel_clone+0xac/0x6e0 kernel/fork.c:2651
__do_sys_clone+0x7f/0xb0 kernel/fork.c:2792
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
📍 영향받는 시스템
Linux kernel (nfsd module 사용 환경)
⚔️ 공격 벡터
로컬 사용자가 nfsd 관련 시스템 호출(sendmsg 등)을 반복적으로 수행하여 메모리 고갈 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 nfsd_nl_threads_set_doit() 함수 수정 사항 반영
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인합니다.