🇰🇷 한글 설명
Linux kernel의 nilfs2 파일시스템에서 손상된 b-tree 구조를 가진 이미지 처리 시 NULL 포인터 역참조 취약점입니다. Root 노드의 자식이 0개인데도 트리 높이가 2 이상인 경우, 경로 배열 초기화 검증 부재로 인해 발생합니다.
💡 쉬운 설명
특정 Linux 파일시스템이 손상된 데이터를 읽을 때 존재하지 않는 메모리에 접근하여 시스템이 중단됩니다. 손상된 저장소 마운트 시 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix potential null-ptr-deref in nilfs_btree_insert()
Patch series "nilfs2: fix potential issues with empty b-tree nodes".
This series addresses three potential issues with empty b-tree nodes that
can occur with corrupted filesystem images, including one recently
discovered by syzbot.
This patch (of 3):
If a b-tree is broken on the device, and the b-tree height is greater than
2 (the level of the root node is greater than 1) even if the number of
child nodes of the b-tree root is 0, a NULL pointer dereference occurs in
nilfs_btree_prepare_insert(), which is called from nilfs_btree_insert().
This is because, when the number of child nodes of the b-tree root is 0,
nilfs_btree_do_lookup() does not set the block buffer head in any of
path[x].bp_bh, leaving it as the initial value of NULL, but if the level
of the b-tree root node is greater than 1, nilfs_btree_get_nonroot_node(),
which accesses the buffer memory of path[x].bp_bh, is called.
Fix this issue by adding a check to nilfs_btree_root_broken(), which
performs sanity checks when reading the root node from the device, to
detect this inconsistency.
Thanks to Lizhi Xu for trying to solve the bug and clarifying the cause
early on.
📍 영향받는 시스템
Linux kernel(nilfs2 파일시스템 사용) - 모든 영향받는 커널 버전, 배포판별 상이함
⚔️ 공격 벡터
로컬 공격자가 손상된 nilfs2 파일시스템 이미지를 생성하여 시스템 마운트/복구 시점에 트리거
🛡️ 대응 방법
Linux kernel을 nilfs2 btree 검증 패치가 적용된 버전으로 업데이트
🔧 검증 코드
nilfs2가 나열되면 지원 중이며, uname 출력 커널 버전을 Linux CVE 추적 데이터베이스에서 검색하여 패치 적용 여부 확인
cat /proc/filesystems | grep nilfs2 && uname -r