🇰🇷 한글 설명
Linux 커널의 md/md-bitmap 모듈에서 bitmap_get_stats() 함수가 외부 비트맵의 슈퍼블록 존재 여부를 제대로 검증하지 않아 발생하는 일반 보호 오류(GPF)입니다. /proc 파일 시스템을 통해 비트맵 통계를 읽을 때 canonical하지 않은 메모리 주소에 접근하여 커널 패닉을 유발합니다.
💡 쉬운 설명
리눅스 커널의 디스크 RAID 관리 시스템이 비트맵 통계를 읽을 때 메모리 주소를 잘못 참조하여 시스템이 크래시할 수 있습니다. 시스템 설정 파일(/proc)을 읽어 권한 있는 사용자가 이 문제를 트리거할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
md/md-bitmap: fix GPF in bitmap_get_stats()
The commit message of commit 6ec1f0239485 ("md/md-bitmap: fix stats
collection for external bitmaps") states:
Remove the external bitmap check as the statistics should be
available regardless of bitmap storage location.
Return -EINVAL only for invalid bitmap with no storage (neither in
superblock nor in external file).
But, the code does not adhere to the above, as it does only check for
a valid super-block for "internal" bitmaps. Hence, we observe:
Oops: GPF, probably for non-canonical address 0x1cd66f1f40000028
RIP: 0010:bitmap_get_stats+0x45/0xd0
Call Trace:
seq_read_iter+0x2b9/0x46a
seq_read+0x12f/0x180
proc_reg_read+0x57/0xb0
vfs_read+0xf6/0x380
ksys_read+0x6d/0xf0
do_syscall_64+0x8c/0x1b0
entry_SYSCALL_64_after_hwframe+0x76/0x7e
We fix this by checking the existence of a super-block for both the
internal and external case.
📍 영향받는 시스템
Linux kernel md/md-bitmap 모듈 (commit 6ec1f0239485 이후 버전)
⚔️ 공격 벡터
/proc/mdstat 또는 관련 프로세스 통계 파일 읽기를 통한 bitmap_get_stats() 함수 호출
🛡️ 대응 방법
Linux 커널을 최신 버전으로 업데이트하거나 배포판에서 제공하는 보안 패치 적용
🔧 검증 코드
md/md-bitmap 활성화 상태 확인 및 커널 버전 확인. 취약점이 패치된 버전 이상인지 확인 필요
cat /proc/mdstat 2>/dev/null | head -5; uname -r