🇰🇷 한글 설명
Linux 커널의 NILFS2 파일 시스템에서 inode 번호 범위 검사 미흡으로 인해 발생하는 취약점입니다. 손상된 파일 시스템의 슈퍼블록 내 inode 시작 번호가 비정상적으로 설정될 경우, Use-After-Free 오류나 정의되지 않은 비트 이동 연산으로 인한 시스템 오작동이 발생할 수 있습니다.
💡 쉬운 설명
파일 시스템의 관리 번호가 규칙을 벗어나게 설정될 경우, 컴퓨터가 잘못된 메모리 영역을 참조하여 시스템이 멈추거나 오류가 발생할 수 있는 문제입니다. 파일 시스템 데이터가 깨졌을 때 발생할 수 있는 보안 결함입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix inode number range checks
Patch series "nilfs2: fix potential issues related to reserved inodes".
This series fixes one use-after-free issue reported by syzbot, caused by
nilfs2's internal inode being exposed in the namespace on a corrupted
filesystem, and a couple of flaws that cause problems if the starting
number of non-reserved inodes written in the on-disk super block is
intentionally (or corruptly) changed from its default value.
This patch (of 3):
In the current implementation of nilfs2, "nilfs->ns_first_ino", which
gives the first non-reserved inode number, is read from the superblock,
but its lower limit is not checked.
As a result, if a number that overlaps with the inode number range of
reserved inodes such as the root directory or metadata files is set in the
super block parameter, the inode number test macros (NILFS_MDT_INODE and
NILFS_VALID_INODE) will not function properly.
In addition, these test macros use left bit-shift calculations using with
the inode number as the shift count via the BIT macro, but the result of a
shift calculation that exceeds the bit width of an integer is undefined in
the C specification, so if "ns_first_ino" is set to a large value other
than the default value NILFS_USER_INO (=11), the macros may potentially
malfunction depending on the environment.
Fix these issues by checking the lower bound of "nilfs->ns_first_ino" and
by preventing bit shifts equal to or greater than the NILFS_USER_INO
constant in the inode number test macros.
Also, change the type of "ns_first_ino" from signed integer to unsigned
integer to avoid the need for type casting in comparisons such as the
lower bound check introduced this time.
📍 영향받는 시스템
NILFS2 파일 시스템을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
손상되거나 조작된 NILFS2 파일 시스템의 슈퍼블록을 마운트하여 발생
🛡️ 대응 방법
NILFS2 inode 범위 검사 및 비트 연산 로직이 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인