🇰🇷 한글 설명
Linux 커널의 NTFS 드라이버에서 restart-area 길이를 계산할 때 u16 정수 오버플로(truncation)가 발생하는 취약점입니다. 공격자가 조작된 NTFS 이미지를 마운트하게 유도하면, 커널 메모리 경계를 벗어난 읽기(Out-of-bounds read)가 발생하여 시스템 안정성을 해치거나 정보를 유출할 수 있습니다.
💡 쉬운 설명
NTFS라는 저장 장치 형식을 읽을 때, 숫자가 너무 커서 계산 오류가 발생하는 버그가 있습니다. 이 오류를 이용해 나쁜 파일을 연결하면 컴퓨터의 중요한 메모리 영역을 몰래 훔쳐볼 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ntfs: fix u16 truncation of restart-area length check
ntfs_check_restart_area() validates that the $LogFile restart area and
its trailing log client record array fit within the system page size:
u16 ra_ofs, ra_len, ca_ofs;
...
ra_len = ca_ofs + le16_to_cpu(ra->log_clients) *
sizeof(struct log_client_record);
if (ra_ofs + ra_len > le32_to_cpu(rp->system_page_size) || ...)
return false;
ra_len is u16, but the right-hand side is computed in size_t
(sizeof(struct log_client_record) == 160). Both ca_ofs and log_clients
come straight from the on-disk restart area. With an on-disk
log_clients of 410 the product 410 * 160 = 65600; adding ca_ofs and
storing into the u16 ra_len truncates modulo 65536 (e.g. ca_ofs 64
gives ra_len 128), so the "fits in the page" check passes even though
the client array described by log_clients extends far beyond the page.
ntfs_check_log_client_array() then walks the array bounded only by the
on-disk log_clients count:
cr = ca + idx;
if (cr->prev_client != LOGFILE_NO_CLIENT) ...
For log_clients 410 it dereferences records up to ca + 409 * 160,
~64 KiB past the kvzalloc(system_page_size) restart-page buffer -- an
out-of-bounds read of attacker-controlled extent, reachable when a
crafted NTFS image is mounted (load_and_check_logfile() at mount time).
This is the in-kernel analogue of CVE-2022-30789, fixed in the ntfs-3g
userspace driver but never in this revived classic driver.
Compute the restart-area length in a u32 so the existing bounds check
rejects an over-large client array instead of being defeated by the
truncation. Widen ra_ofs and ca_ofs to u32 as well: both are loaded
from __le16 on-disk fields and every comparison already promotes to
int/size_t, so this changes no result and keeps the declaration uniform.
📍 영향받는 시스템
Linux kernel (NTFS driver 사용 시스템)
⚔️ 공격 벡터
조작된 NTFS 파일 시스템 이미지를 마운트하도록 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인