🇰🇷 한글 설명
Linux 커널의 CIFS 구현체에서 cifs_remap_file_range() 함수 호출 시 len이 0인 경우 loff_t 언더플로우가 발생할 수 있는 취약점입니다. 오프셋(off) 값이 파일 크기(i_size)보다 클 경우 계산된 길이가 음수가 되어 ByteCount를 손상시키고 파일 범위 매핑을 반전시킬 수 있습니다.
💡 쉬운 설명
파일의 특정 범위를 복사하는 과정에서 계산 오류를 일으켜 데이터가 잘못된 위치에 기록될 수 있는 문제입니다. 공격자가 이를 악용하면 파일의 내용을 의도치 않게 덮어쓰거나 손상시킬 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
cifs: fix loff_t underflow in cifs_remap_file_range() when len == 0
With len == 0 (clone to EOF), the effective length is computed as:
len = src_inode->i_size - off;
If off > i_size, this is a negative loff_t, corrupting the ByteCount
in the FSCTL_DUPLICATE_EXTENTS_TO_FILE request and inverting the range
in filemap_write_and_wait_range(). The existing off >= i_size check
fires only after the ioctl has already been sent.
Snapshot i_size_read() once for both the bounds check and the length
calculation, eliminating the TOCTOU and 32-bit torn-read risk. Reject
off > src_size with -EINVAL. Treat off == src_size as a no-op,
consistent with __generic_remap_file_range_prep().
📍 영향받는 시스템
Linux Kernel (CIFS 모듈 사용 시스템)
⚔️ 공격 벡터
조작된 오프셋 값을 포함한 FSCTL_DUPLICATE_EXTENTS_TO_FILE ioctl 요청을 통한 로컬 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.