🇰🇷 한글 설명
Linux 커널의 EROFS 파일 시스템에서 기본 장치와 추가 장치의 유형이 일치하지 않을 때 발생하는 Use-After-Free(UAF) 취약점입니다. 기본 장치가 블록 장치이고 추가 장치가 파일 기반 장치인 경우, 초기화 오류가 적절히 처리되지 않아 메모리 해제 후 참조 오류가 발생할 수 있습니다.
💡 쉬운 설명
파일 시스템을 불러올 때 서로 다른 종류의 저장 장치를 섞어서 사용하면 컴퓨터 메모리 관리 오류가 발생합니다. 이 오류를 이용해 해커가 시스템의 제어권을 획득하거나 오류를 일으킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
erofs: avoid using multiple devices with different type
For multiple devices, both primary and extra devices should be the
same type. `erofs_init_device` has already guaranteed that if the
primary is a file-backed device, extra devices should also be
regular files.
However, if the primary is a block device while the extra device
is a file-backed device, `erofs_init_device` will get an ENOTBLK,
which is not treated as an error in `erofs_fc_get_tree`, and that
leads to an UAF:
erofs_fc_get_tree
get_tree_bdev_flags(erofs_fc_fill_super)
erofs_read_superblock
erofs_init_device // sbi->dif0 is not inited yet,
// return -ENOTBLK
deactivate_locked_super
free(sbi)
if (err is -ENOTBLK)
sbi->dif0.file = filp_open() // sbi UAF
So if -ENOTBLK is hitted in `erofs_init_device`, it means the
primary device must be a block device, and the extra device
is not a block device. The error can be converted to -EINVAL.
📍 영향받는 시스템
Linux Kernel (EROFS 파일 시스템을 사용하는 버전)
⚔️ 공격 벡터
서로 다른 유형의 장치(블록 장치와 파일 기반 장치)를 혼합하여 EROFS 파일 시스템을 마운트 시도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 EROFS 관련 취약점이 수정된 최신 패치 버전인지 확인