🇰🇷 한글 설명
Linux 커널의 CIFS 구현에서 cifs_file_set_size() 함수 호출 시 tcon 참조가 적절히 해제되지 않아 발생하는 Use-After-Free 취약점입니다. 파일 크기 변경 시도 중 오류가 발생하면 이미 해제된 tcon 메모리 영역에 접근하게 되어 시스템 불안정이나 권한 상승을 초래할 수 있습니다.
💡 쉬운 설명
파일 크기를 조절하는 과정에서 컴퓨터가 이미 사용이 끝난 메모리 주소를 다시 사용하려고 시도할 때 발생하는 오류입니다. 이로 인해 시스템이 멈추거나 해커가 시스템 제어권을 얻을 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
cifs: clear tcon after cifsFileInfo_put() in cifs_file_set_size()
When the else branch of cifs_file_set_size() finds a writable file handle
via find_writable_file(), it borrows tcon and server from the handle's
tlink, attempts the handle-based set_file_size() RPC, and then releases
the handle with cifsFileInfo_put().
If set_file_size() fails, execution falls through to the path-based
fallback, which reuses the borrowed tcon and server under the
"if (tcon == NULL)" guard. Since tcon is not NULL at that point, the
guard is skipped. If cifsFileInfo_put() dropped the last reference on a
tlink that was already removed from the tlink tree (TCON_LINK_IN_TREE
cleared, as happens during reconnection or session teardown),
cifs_put_tlink() will have freed tcon; the subsequent set_path_size()
call is then a use-after-free.
Setting tcon = NULL after cifsFileInfo_put() causes the existing guard
to take the cifs_sb_tlink() path, which acquires a fresh reference for
the path-based operation or fails cleanly if the session is gone.
📍 영향받는 시스템
Linux Kernel (CIFS 모듈 사용 환경)
⚔️ 공격 벡터
네트워크를 통해 조작된 CIFS 파일 크기 변경 요청을 전송하여 메모리 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인