🇰🇷 한글 설명
Linux 커널의 configfs 구성 요소에서 rmdir 작업 시 dentry를 적절히 unhash하지 않아 발생하는 Use-After-Free 취약점입니다. 이로 인해 symlink 생성 과정에서 이미 해제된 메모리 영역에 접근하여 시스템 오류나 커널 패닉이 발생할 수 있습니다.
💡 쉬운 설명
파일을 삭제하는 과정에서 컴퓨터가 이미 지워진 데이터의 주소를 여전히 유효하다고 착각하여 발생하는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
configfs: unhash the dentry before dropping the item in rmdir
configfs_get_config_item() treats a hashed dentry as proof that
sd->s_element is a live config_item. configfs_rmdir() breaks that:
simple_rmdir() leaves the dentry hashed, the last reference to the item is
dropped right after, and the dentry is only unhashed by d_delete() once
->rmdir() has returned. configfs_symlink() resolves its target holding no
lock on it, so get_target() can land in that window:
BUG: KASAN: slab-use-after-free in config_item_get+0x26/0x90
get_target fs/configfs/symlink.c:128 [inline]
configfs_symlink+0x4ab/0x1030 fs/configfs/symlink.c:185
Unhash in configfs_remove_dir(), while the item is still guaranteed to be
there. A reference obtained just before that stays harmless, as
create_link() rechecks CONFIGFS_USET_DROPPING, already set by
configfs_detach_prep(). Both configfs_unregister_subsystem() paths
d_drop() after detaching, so this only makes rmdir match them.
📍 영향받는 시스템
configfs를 사용하는 Linux 커널 버전 (패치 적용 전 버전)
⚔️ 공격 벡터
로컬 공격자가 configfs를 통해 특정 순서로 디렉토리 삭제 및 심볼릭 링크 생성을 시도하여 메모리 오류 유도
🛡️ 대응 방법
configfs_remove_dir() 함수가 dentry를 적절히 unhash하도록 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 최신 보안 패치 버전인지 확인