🇰🇷 한글 설명
Linux 커널의 VFS에서 umount 시 연결이 끊긴 dentry가 메모리에서 해제되지 않고 누수되는 취약점입니다. 특정 상황에서 dentry의 disconnected 플래그가 일관되지 않게 설정되어, 파일 시스템 언마운트 후에도 inode가 'Busy' 상태로 남아 메모리 누수 및 시스템 오류를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터가 파일을 정리하고 연결을 끊어야 할 때, 일부 정보가 제대로 삭제되지 않고 메모리에 계속 남아있는 문제입니다. 이로 인해 시스템 메모리가 낭비되거나 장치를 안전하게 분리할 수 없는 문제가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
vfs: Don't leak disconnected dentries on umount
When user calls open_by_handle_at() on some inode that is not cached, we
will create disconnected dentry for it. If such dentry is a directory,
exportfs_decode_fh_raw() will then try to connect this dentry to the
dentry tree through reconnect_path(). It may happen for various reasons
(such as corrupted fs or race with rename) that the call to
lookup_one_unlocked() in reconnect_one() will fail to find the dentry we
are trying to reconnect and instead create a new dentry under the
parent. Now this dentry will not be marked as disconnected although the
parent still may well be disconnected (at least in case this
inconsistency happened because the fs is corrupted and .. doesn't point
to the real parent directory). This creates inconsistency in
disconnected flags but AFAICS it was mostly harmless. At least until
commit f1ee616214cb ("VFS: don't keep disconnected dentries on d_anon")
which removed adding of most disconnected dentries to sb->s_anon list.
Thus after this commit cleanup of disconnected dentries implicitely
relies on the fact that dput() will immediately reclaim such dentries.
However when some leaf dentry isn't marked as disconnected, as in the
scenario described above, the reclaim doesn't happen and the dentries
are "leaked". Memory reclaim can eventually reclaim them but otherwise
they stay in memory and if umount comes first, we hit infamous "Busy
inodes after unmount" bug. Make sure all dentries created under a
disconnected parent are marked as disconnected as well.
📍 영향받는 시스템
Linux Kernel (특정 커밋 f1ee616214cb 이후의 버전)
⚔️ 공격 벡터
로컬 공격자가 파일 시스템의 손상이나 race condition을 유도하여 메모리 누수를 발생시킴
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 패치 버전인지 확인