🇰🇷 한글 설명
Linux 커널의 VFS 계층에서 nfsd4_create_file() 함수가 특정 오류 상황 시 부모 디렉토리를 잠금 해제하지 못하는 취약점이 발견되었습니다. atomic_create()가 오류를 반환할 때 dentry 참조를 해제하는 과정에서 발생하며, 이로 인해 파일 시스템의 잠금이 유지되는 문제가 발생합니다.
💡 쉬운 설명
파일을 만들다가 오류가 발생했을 때, 시스템이 사용하던 파일 폴더의 잠금을 제대로 풀지 못하는 버그입니다. 이 문제가 지속되면 특정 파일 시스템 작업이 멈추거나 시스템 성능에 영향을 줄 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
VFS: fix possible failure to unlock in nfsd4_create_file()
atomic_create() in fs/namei.c drops the reference to the dentry
when it returns an error.
This behaviour was imported into dentry_create() so that it
will drop the reference if an error is returned from atomic_create(),
though not if vfs_create() returns an error (in the case where
->atomic_create is not supported).
The caller - nfsd4_create_file() - is made aware of this by checking
path->dentry, which will either be a counted reference to a dentry, or
an error pointer.
However the change to use start_creating()/end_creating() (which landed
shortly before the dentry_create() change landed, though was likely
developed around the same time) means that nfsd4_create_file() *needs* a
valid dentry so that it can unlock the parent.
The net result is that if NFSD exports a filesystem which uses
->atomic_create, and if a call to ->atomic_create returns an error, then
nfsd4_create_file() will pass an error pointer to end_creating()
and the parent will not be unlocked.
Fix this by changing dentry_create() to make sure path->dentry is always
a valid dentry, never an error-pointer. The actual error is already
returned a different way.
Note that if ->atomic_create() returns a different dentry (which may not
be possible in practice) we are guaranteed (because it is only ever
provided by d_spliace_alias()) that it will have the same d_parent and
so it will have the same effect when passed to end_creating().
📍 영향받는 시스템
atomic_create를 사용하는 파일 시스템을 내보내는(export) NFSD를 사용하는 Linux 커널
⚔️ 공격 벡터
공격자가 특정 오류를 유발하는 파일 생성 요청을 보내 시스템의 잠금(lock)을 유지시켜 서비스 거부(DoS) 유도
🛡️ 대응 방법
해당 취약점이 수정된 최신 버전의 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 보안 업데이트 버전인지 확인