🇰🇷 한글 설명
Linux 커널의 ntfs3 파일 시스템 드라이버에서 mi_enum_attr() 함수 내 VCN(가상 클러스터 번호) 유효성 검사 오류가 발견되었습니다. evcn 값이 최대값(U64_MAX)일 때 정수 오버플로가 발생하여 잘못된 범위의 속성이 허용될 수 있는 취약점입니다.
💡 쉬운 설명
파일 시스템이 데이터를 읽을 때 숫자가 너무 커서 계산 오류가 발생하는 문제입니다. 이로 인해 조작된 파일 시스템을 통해 시스템에 잘못된 데이터가 입력될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fs/ntfs3: reject out-of-range evcn in mi_enum_attr()
In mi_enum_attr(), the start/end VCN validation for non-resident
attributes is:
if (svcn > evcn + 1) goto out;
When evcn is U64_MAX the "evcn + 1" expression wraps to 0 and any svcn
passes the check. For evcn values close to U64_MAX (but not equal to it)
the right-hand side is still a meaningless near-wrap upper bound, so a
malformed on-disk attribute with svcn == 0 and evcn near U64_MAX can pass
mi_enum_attr() unrejected.
VCN (virtual cluster number) is a cluster index, so any valid evcn is
bounded by the volume's total cluster count, which ntfs3 holds in
sbi->used.bitmap.nbits (set up in ntfs_init_from_boot() before any caller
of mi_enum_attr() runs). Reject evcn values that fall outside this range.
However, an empty non-resident attribute (no allocated clusters) is
legitimately encoded with svcn == 0 and evcn == -1 (U64_MAX), e.g. via
attr->nres.evcn = cpu_to_le64((u64)vcn - 1) with vcn == 0. That sentinel
must keep passing, so exclude evcn == U64_MAX from the range check. The
existing "svcn > evcn + 1" test still tolerates the sentinel ("0 > 0" is
false) and continues to require svcn == 0 for it, while the range check
rejects every other out-of-range evcn and thereby also defuses the
"evcn + 1" wraparound.
svcn does not need its own bound: once evcn < nbits, "svcn > evcn + 1"
implies svcn <= nbits.
[
[email protected]: fixed evcn check]
📍 영향받는 시스템
Linux kernel (ntfs3 driver 사용 시스템)
⚔️ 공격 벡터
조작된(malformed) 온디스크 NTFS 속성을 가진 저장 매체를 연결하여 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인