🇰🇷 한글 설명
Linux 커널의 ksmbd 모듈에서 oplock 해제 알림 처리 중 Use-After-Free 취약점이 발견되었습니다. 인증된 클라이언트가 지속적인 배치 oplock를 보유한 상태에서 세션 해제와 알림 처리가 경합할 경우, 이미 해제된 연결 객체에 접근하여 시스템 오류나 권한 상승을 유발할 수 있습니다.
💡 쉬운 설명
서버와 연결된 사용자가 갑자기 접속을 끊을 때, 서버가 이미 사라진 연결 정보를 다시 사용하려고 시도하면서 발생하는 보안 결함입니다. 이를 통해 공격자는 시스템을 불안정하게 만들거나 제어권을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix use-after-free in oplock break notification
smb2_oplock_break_noti() reads opinfo->conn without any lock and
dereferences it after two allocations which may sleep. When the
durable handle owning the oplock is disconnected, session_fd_check()
clears opinfo->conn and drops its conn reference under ci->m_lock, and
the last ksmbd_conn_put() frees the connection. A break triggered by
another connection that races with the teardown can then resurrect the
freed connection: ksmbd_conn_get() is a plain atomic_inc, and the
queued break work later dereferences the stale conn via
ksmbd_conn_write(), a use-after-free reachable by any authenticated
client holding a durable batch oplock.
Thread the caller's inode into the notification path instead of taking
a new reference on it. Every caller of oplock_break() already holds a
live ksmbd_file (or an explicit ksmbd_inode_lookup_lock() reference,
in the parent lease break paths) on the inode that owns the break
target's oplock list, so ci cannot be freed during the call, and its
lock can be taken without dereferencing opinfo->o_fp, which a
concurrent close may free. Select and pin the connection under
ci->m_lock, the same lock session_fd_check() and
ksmbd_reopen_durable_fd() use to update opinfo->conn, so a concurrent
detach either loses the race to the clear or keeps the connection
alive until the notification work releases it. Transfer the reference
to the work item and release it on allocation failures.
📍 영향받는 시스템
ksmbd 모듈을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
인증된 클라이언트가 지속적인 배치 oplock를 유지한 상태에서 세션 해제와 oplock 해제 알림 간의 경합 유도
🛡️ 대응 방법
ksmbd 관련 Use-After-Free 취약점이 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 ksmbd 취약점이 패치된 최신 보안 업데이트 버전인지 확인