🇰🇷 한글 설명
Linux kernel의 smb/server 모듈에서 ReplaceIfExists 플래그로 파일 링크 생성 시, 기존 파일이 있으면 부모 디렉토리 잠금으로 인한 데드락이 발생합니다. 패치는 unlock 호출을 link 함수 이전으로 이동시켜 교착 상태를 해결합니다.
💡 쉬운 설명
네트워크 파일 공유(SMB) 기능에서 파일을 대체하면서 링크할 때 시스템이 멈추는 문제입니다. 디렉토리 접근 권한 잠금이 풀리지 않아 다음 작업이 진행되지 않습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
smb/server: avoid deadlock when linking with ReplaceIfExists
If smb2_create_link() is called with ReplaceIfExists set and the name
does exist then a deadlock will happen.
ksmbd_vfs_kern_path_locked() will return with success and the parent
directory will be locked. ksmbd_vfs_remove_file() will then remove the
file. ksmbd_vfs_link() will then be called while the parent is still
locked. It will try to lock the same parent and will deadlock.
This patch moves the ksmbd_vfs_kern_path_unlock() call to *before*
ksmbd_vfs_link() and then simplifies the code, removing the file_present
flag variable.
📍 영향받는 시스템
Linux kernel의 ksmbd (Kernel SMB Server) 모듈을 사용하는 시스템
⚔️ 공격 벡터
로컬 또는 원격 SMB 클라이언트가 ReplaceIfExists 플래그를 포함하여 기존 파일을 대체하는 링크 생성 요청을 보냄
🛡️ 대응 방법
Linux kernel을 취약점 패치가 포함된 최신 버전으로 업그레이드
🔧 검증 코드
커널 버전을 확인합니다. 2025년 이후의 LTS 버전(6.6.x 이상) 또는 패치가 적용된 최신 버전이면 안전합니다.