🇰🇷 한글 설명
Linux 커널의 ntfs3 파일 시스템에서 EA(Extended Attribute) 레코드의 크기 검증 미흡으로 인해 발생하는 취약점입니다. 조작된 NTFS 이미지를 통해 ef->size 값이 실제 데이터보다 작게 설정될 경우, ntfs_get_ea 함수가 할당된 범위를 벗어나 메모리를 읽게 되어 힙 메모리 정보가 유출될 수 있습니다.
💡 쉬운 설명
컴퓨터가 파일의 정보를 읽을 때, 실제 데이터 크기보다 훨씬 큰 값을 읽으라고 속이는 방식입니다. 이로 인해 컴퓨터 내부의 중요한 비밀 정보가 담긴 메모리 영역이 외부로 유출될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fs/ntfs3: validate ef->size covers the record's name and value
When an EA record has a non-zero ef->size, ntfs_read_ea() only checks
that the record fits in the remaining buffer (ea_size > bytes), not that
ef->size is large enough to hold the record's own name_len + 1 + elength.
A crafted image can pass validation with, e.g., ef->size = 24 but
elength = 0xffff. ntfs_get_ea() then trusts elength and copies it out of
the undersized record, reading past the kmalloc(info->size) allocation
and leaking heap memory to userspace via getxattr():
BUG: KASAN: slab-out-of-bounds in ntfs_get_ea (fs/ntfs3/xattr.c:302)
Read of size 65535 at addr ffff888100794550 by task exploit
__asan_memcpy (mm/kasan/shadow.c:105)
ntfs_get_ea (fs/ntfs3/xattr.c:302)
ntfs_getxattr (fs/ntfs3/xattr.c:848)
__vfs_getxattr (fs/xattr.c:441)
vfs_getxattr (fs/xattr.c:474)
do_getxattr (fs/xattr.c:800)
path_getxattrat (fs/xattr.c:868)
do_syscall_64 (arch/x86/entry/syscall_64.c:94)
The buggy address is located 80 bytes inside of
allocated 84-byte region in cache kmalloc-96
Compute the size the record needs and require ef->size to cover it.
📍 영향받는 시스템
Linux kernel (ntfs3 driver 사용 시)
⚔️ 공격 벡터
조작된 NTFS 파일 시스템 이미지를 마운트하여 getxattr() 시스템 호출을 수행
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인