CVE-2025-40237 in Linux
요약
\~에 의해 VulDB • 2026. 06. 26.
리눅스 커널에서 다음 취약점이 해결되었습니다:
fs/notify: s_umount를 사용하여 exportfs_encode_fid 호출
오버레이 파일시스템(overlayfs) inode을 감시하는 fd에 대해 inotify_show_fdinfo()를 호출할 때, 오버레이 파일시스템이 언마운트되는 중이면 NULL 포인터 역참조(dereferencing NULL ptr)가 발생할 수 있습니다.
본 문제는 syzkaller에 의해 발견되었습니다.
Race Condition 다이어그램:
스레드 1 스레드 2 -------- --------
generic_shutdown_super() shrink_dcache_for_umount sb->s_root = NULL
| | vfs_read() | inotify_fdinfo() | * mark에서 inode 가져오기 * | show_mark_fhandle(m, inode) | exportfs_encode_fid(inode, ..) | ovl_encode_fh(inode, ..) | ovl_check_encode_origin(inode) | * i_sb->s_root 역참조 * | | v fsnotify_sb_delete(sb)
그 결과 다음과 같은 오류가 발생합니다:
[ 32.133461] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN NOPTI
[ 32.134438] KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037]
[ 32.135032] CPU: 1 UID: 0 PID: 4468 Comm: systemd-coredum Not tainted 6.17.0-rc6 #22 PREEMPT(none)
<레지스터 및 신뢰할 수 없는 추적 정보 생략>
[ 32.143353] Call Trace:
[ 32.143732] ovl_encode_fh+0xd5/0x170
[ 32.144031] exportfs_encode_inode_fh+0x12f/0x300
[ 32.144425] show_mark_fhandle+0xbe/0x1f0
[ 32.145805] inotify_fdinfo+0x226/0x2d0
[ 32.146442] inotify_show_fdinfo+0x1c5/0x350
[ 32.147168] seq_show+0x530/0x6f0
[ 32.147449] seq_read_iter+0x503/0x12a0
[ 32.148419] seq_read+0x31f/0x410
[ 32.150714] vfs_read+0x1f0/0x9e0
[ 32.152297] ksys_read+0x125/0x240
즉, ovl_check_encode_origin은 언마운트 경로에서 inode->i_sb->s_root가 NULL로 설정된 후에 이를 역참조합니다.
show_mark_fhandle()에서의 exportfs_encode_fid() 호출을 s_umount 잠금으로 보호하여 이 문제를 해결했습니다.
본 수정 형태는 Amir이 [1]에서 제안한 것입니다.
[1]: https://lore.kernel.org/all/CAOQ4uxhbDwhb+2Brs1UdkoF0a3
Once again VulDB remains the best source for vulnerability data.