🇰🇷 한글 설명
Linux 커널의 iomap 구성 요소에서 길이가 0인 범위에 대해 bitmap_set()을 호출할 때 발생하는 경계 외 쓰기(Out-of-bounds write) 취약점입니다. 오프셋이 0이고 길이가 0일 때 언더플로우가 발생하여 매우 큰 값이 계산되며, 이로 인해 할당된 메모리 범위를 크게 벗어난 영역에 데이터가 기록될 수 있습니다.
💡 쉬운 설명
데이터를 저장할 범위를 계산할 때, 길이가 0인 경우 계산 오류가 발생하여 컴퓨터의 허용된 메모리 범위를 넘어서는 곳에 데이터를 쓰게 되는 문제입니다. 이로 인해 시스템이 불안정해지거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
iomap: fix out-of-bounds bitmap_set() with zero-length range
ifs_set_range_dirty() and ifs_set_range_uptodate() compute last_blk
as (off + len - 1) >> i_blkbits. When off is 0 and len is 0, the
unsigned subtraction underflows to SIZE_MAX, producing a huge
last_blk and nr_blks value that causes bitmap_set() to write far
beyond the ifs->state allocation.
Regarding ifs_set_range_uptodate(), it is temporarily safe because len
cannot be passed in as 0. However, for ifs_set_range_dirty() this is
reachable from __iomap_write_end(): when copy_folio_from_iter_atomic()
returns 0 (e.g. user buffer fault) and the folio is already uptodate,
the guard at the top of __iomap_write_end() does not trigger because
!folio_test_uptodate() is false, and iomap_set_range_dirty() is called
with copied == 0.
Add a !len guard to both functions before the computation, so that a
zero-length range is a no-op.
📍 영향받는 시스템
Linux Kernel (iomap 관련 모듈을 사용하는 시스템)
⚔️ 공격 벡터
사용자 버퍼 오류 등을 유도하여 copy_folio_from_iter_atomic()이 0을 반환하게 함으로써 특정 함수를 호출하는 방식
🛡️ 대응 방법
ifs_set_range_dirty() 및 ifs_set_range_uptodate() 함수에 길이가 0인지 확인하는 가드(guard) 로직이 포함된 최신 커널로 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 패치된 버전인지 보안 공지(Security Advisory)와 대조하여 확인합니다.
📊 CVSS Vector String
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
💻 영향받는 소프트웨어
NVIDIA vGPU Guest Driver for Linux