🇰🇷 한글 설명
Linux 커널의 NILFS2 파일 시스템에서 GC ioctl 호출 시 유효하지 않은 블록 인덱스를 허용하여 발생하는 취약점입니다. 공격자가 조작된 매개변수를 통해 ULONG_MAX 인덱스를 가진 페이지를 페이지 캐시에 삽입하면, 리스트 중복 추가로 인해 리스트 손상이 발생할 수 있습니다.
💡 쉬운 설명
파일 시스템의 정리 작업(GC)을 수행할 때 잘못된 번호의 데이터를 입력하면 시스템 내부의 데이터 목록이 꼬여버리는 문제입니다. 이로 인해 시스템이 불안정해지거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: reject invalid block index in GC ioctl
Syzbot reported list corruption caused by a double list_add_tail() call on
bh->b_assoc_buffers within nilfs_lookup_dirty_data_buffers().
Analysis revealed that the root cause was the insertion of a page/folio
with a page index of ULONG_MAX into the page cache via the GC ioctl.
filemap_get_folios_tag(), called by nilfs_lookup_dirty_data_buffers(),
repeatedly detects a dirty folio with a page index of ULONG_MAX due to
index wrap-around, leading to duplicate processing of dirty buffers.
As a preparatory step, the GC ioctl loads the page/folio of the block to
be moved during GC and inserts it into the page cache based on information
in the nilfs_vdesc structure passed as an argument. Normally, this does
not cause issues because the user-space GC library configures the
nilfs_vdesc structure properly. However, since there is no range check on
the parameters determining the page index, a request with artificially
crafted parameters -- such as those generated by Syzbot -- can result in a
page/folio being inserted with a page index of ULONG_MAX, triggering the
above problem.
This resolves the issue by checking the ranges of 'vd_offset' and
'vd_vblocknr' in the nilfs_vdesc structure that determine the page index,
thereby preventing the invalid page/folio insertions.
📍 영향받는 시스템
Linux kernel (NILFS2 파일 시스템을 사용하는 버전)
⚔️ 공격 벡터
조작된 nilfs_vdesc 구조체 매개변수를 포함한 GC ioctl 호출
🛡️ 대응 방법
NILFS2의 GC ioctl에서 vd_offset 및 vd_vblocknr 범위 검증 로직이 포함된 최신 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인합니다.