🇰🇷 한글 설명
Linux 커널의 exfat 파일 시스템 구현 중 exfat_find_dir_entry() 함수에서 발생하는 취약점입니다. 파일 이름 조각을 처리할 때 실제 이름 길이와 포인터 이동 거리 간의 불일치로 인해 버퍼 범위를 벗어나는 읽기 및 쓰기가 발생할 수 있습니다.
💡 쉬운 설명
조작된 exFAT 저장 장치를 연결하면 컴퓨터의 메모리 영역을 넘어서 데이터를 읽거나 쓰는 오류가 발생할 수 있습니다. 이로 인해 시스템이 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
exfat: bound uniname advance in exfat_find_dir_entry()
In exfat_find_dir_entry(), each TYPE_EXTEND (file name) entry advances the
output pointer by a fixed amount while the loop guard only tracks the
accumulated name length:
if (++order == 2)
uniname = p_uniname->name;
else
uniname += EXFAT_FILE_NAME_LEN;
len = exfat_extract_uni_name(ep, entry_uniname);
name_len += len;
unichar = *(uniname+len);
*(uniname+len) = 0x0;
uniname grows by EXFAT_FILE_NAME_LEN (15) per name entry, but name_len
grows only by the actual extracted length, which is shorter when a name
fragment contains an early NUL. The only guard is
`name_len >= MAX_NAME_LENGTH`, so a crafted directory with many short
name fragments lets uniname run far past the
p_uniname->name[MAX_NAME_LENGTH + 3] buffer while name_len stays small,
causing an out-of-bounds read and write at *(uniname+len).
The sibling extractor exfat_get_uniname_from_ext_entry() already stops
on a short fragment (the lockstep `len != EXFAT_FILE_NAME_LEN` guard
added in commit d42334578eba ("exfat: check if filename entries exceeds
max filename length")); exfat_find_dir_entry() never got the
equivalent. Track the per-entry write offset as a count and reject a
fragment once the offset, or the offset plus the extracted length, would
exceed MAX_NAME_LENGTH, before forming the output pointer.
📍 영향받는 시스템
exFAT 파일 시스템을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
조작된 파일 이름 조각을 포함하는 exFAT 형식의 디렉토리 또는 저장 매체 삽입
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인