🇰🇷 한글 설명
Linux 커널 NFS 구현에서 디렉토리와 파일이 동시에 같은 이름으로 생성될 때, 디렉토리 alias를 발견해도 오류를 반환하지 않아 음수 dentry가 유지됩니다. 이후 do_dentry_open에서 음수 dentry로 파일 작업을 시도하면 커널 충돌(oops)이 발생하며, d_is_dir() 검사를 통해 디렉토리 inode에 대한 파일 연산을 방지하여 해결됩니다.
💡 쉬운 설명
Linux 커널에서 네트워크 파일 시스템(NFS) 사용 시 같은 이름의 파일과 폴더가 동시에 생성되면 시스템이 크래시할 수 있습니다. 커널을 최신 버전으로 업데이트하면 이 문제가 해결됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nfs: return EISDIR on nfs3_proc_create if d_alias is a dir
If we found an alias through nfs3_do_create/nfs_add_or_obtain
/d_splice_alias which happens to be a dir dentry, we don't return
any error, and simply forget about this alias, but the original
dentry we were adding and passed as parameter remains negative.
This later causes an oops on nfs_atomic_open_v23/finish_open since we
supply a negative dentry to do_dentry_open.
This has been observed running lustre-racer, where dirs and files are
created/removed concurrently with the same name and O_EXCL is not
used to open files (frequent file redirection).
While d_splice_alias typically returns a directory alias or NULL, we
explicitly check d_is_dir() to ensure that we don't attempt to perform
file operations (like finish_open) on a directory inode, which triggers
the observed oops.
📍 영향받는 시스템
Linux kernel (모든 버전, 배포판별 패치 적용 일정 상이)
⚔️ 공격 벡터
NFS를 통해 같은 이름의 파일/디렉토리를 동시에 생성/제거하여 커널 crash 유발
🛡️ 대응 방법
배포판(Ubuntu, RHEL, Debian 등) 보안 업데이트를 통해 Linux 커널 최신 버전으로 업그레이드
🔧 검증 코드
현재 커널 버전을 확인하고, 각 Linux 배포판의 보안 권고에서 제시된 최소 패치 버전 이상인지 비교 검증하면 됩니다.