🇰🇷 한글 설명
Linux 커널의 NTFS 드라이버에서 MFT 레코드를 재사용할 때, 검증되지 않은 usa_ofs 값을 사용하여 업데이트 시퀀스 번호(USN)를 읽는 과정에서 경계 검사가 누락된 취약점입니다. 이로 인해 잘못된 오프셋 값이 제공될 경우 메모리 범위를 벗어난 읽기 작업이 발생하여 KASAN 환경에서 Use-After-Free 오류를 유발할 수 있습니다.
💡 쉬운 설명
NTFS 파일 시스템을 사용하는 리눅스 컴퓨터에서 조작된 파일을 읽을 때, 컴퓨터의 메모리 영역을 잘못된 위치에서 읽어 시스템 오류를 일으킬 수 있는 문제입니다. 이는 파일 시스템의 데이터 구조를 악용하여 시스템의 안정성을 해칠 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ntfs: validate usa_ofs before preserving the update sequence number
When ntfs_mft_record_alloc() reuses a free mft record it reads the old
update sequence number straight from the on-disk record:
usn = *(__le16 *)((u8 *)m + le16_to_cpu(m->usa_ofs));
Here m points into the raw $MFT page-cache folio, which still holds
unvalidated, MST-protected bytes: the folio is read by a plain
iomap_read_folio() and neither post_read_mst_fixup() nor
ntfs_mft_record_check() has run on it (both work on private copies).
m->usa_ofs is therefore an untrusted u16, and a corrupted record can put
it past the end of the record so the two-byte read lands outside the
folio. Reading such a record while creating a file gives, under KASAN:
BUG: KASAN: use-after-free in ntfs_mft_record_alloc+...
Read of size 2 at addr ...
ntfs_mft_record_alloc -> __ntfs_create -> ntfs_create -> path_openat
Only preserve the old update sequence number when usa_ofs is even and in
range, mirroring the check ntfs_mft_record_check() already applies;
otherwise leave usn zero, which the existing restore below skips.
📍 영향받는 시스템
Linux kernel (NTFS driver module)
⚔️ 공격 벡터
조작된(corrupted) NTFS 파일 시스템의 MFT 레코드를 포함한 저장 매체를 마운트하거나 파일을 생성할 때 발생
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 usa_ofs 값에 대한 유효성 검사 로직을 적용해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.