🇰🇷 한글 설명
Linux 커널의 ntfs3 파일 시스템에서 온디스크 페이지 크기를 채택할 때 로그 버퍼 크기를 재조정하지 않아 발생하는 버퍼 오버플로 취약점입니다. 호스트의 초기 할당 크기보다 큰 페이지 크기를 가진 NTFS 볼륨을 마운트할 경우, 작은 크기의 버퍼에 더 큰 데이터를 읽어 들여 메모리 오버플로가 발생합니다.
💡 쉬운 설명
컴퓨터가 파일을 읽을 때 준비한 그릇보다 더 큰 데이터를 억지로 담으려다 메모리가 넘치는 문제입니다. 크기가 다른 저장 장치를 연결할 때 발생할 수 있는 보안 결함입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fs/ntfs3: resize log->one_page_buf when adopting on-disk page size
log_replay() allocates log->one_page_buf using the page size that was
chosen from the host PAGE_SIZE:
log->one_page_buf = kmalloc(log->page_size, GFP_NOFS);
Later, when a restart area is found, the log page size recorded on disk
is adopted:
t32 = le32_to_cpu(log->rst_info.r_page->sys_page_size);
if (log->page_size != t32) {
log->l_size = log->orig_file_size;
log->page_size = norm_file_page(t32, &log->l_size,
t32 == DefaultLogPageSize);
}
If the on-disk page size is larger than the size used for the initial
allocation, log->page_size grows but one_page_buf is left at its
original, smaller size. A subsequent unaligned read_log_page() then
reads log->page_size bytes into the undersized scratch buffer:
page_buf = page_off ? log->one_page_buf : *buffer;
err = ntfs_read_run_nb_ra(ni->mi.sbi, &ni->file.run, page_vbo, page_buf,
log->page_size, NULL, &log->read_ahead);
overflowing the allocation. This is reachable when mounting a dirty
NTFS volume whose log was formatted with a page size larger than the
buffer initially allocated on the mounting host (for example a 64K-log
volume mounted on a host that allocated a 4K scratch buffer).
Grow one_page_buf when the adopted on-disk page size exceeds the size
used for the initial allocation. On krealloc() failure the original
buffer is left intact and freed by the existing error path.
📍 영향받는 시스템
Linux kernel (ntfs3 driver 사용 시)
⚔️ 공격 벡터
공격자가 페이지 크기가 큰 NTFS 볼륨을 조작하여 대상 시스템에 마운트하도록 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인