🇰🇷 한글 설명
Linux 커널의 ksmbd 모듈에서 RPC 핸들 리스트 접근 시 재귀적 잠금(recursive locking)이 발생하는 취약점입니다. 클라이언트가 명명된 파이프(named pipe)를 열려고 시도할 때 세션 락이 중복으로 요청되어 시스템 작업이 멈추는 데드락 현상이 발생합니다.
💡 쉬운 설명
컴퓨터가 특정 작업을 처리하기 위해 자물쇠를 잠갔는데, 그 작업 도중에 똑같은 자물쇠를 또 잠그려고 시도하다가 서로 기다리며 멈춰버리는 문제입니다. 이로 인해 서버 연결이 끊기거나 시스템이 응답하지 않을 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix recursive locking in RPC handle list access
Since commit 305853cce3794 ("ksmbd: Fix race condition in RPC handle list
access"), ksmbd_session_rpc_method() attempts to lock sess->rpc_lock.
This causes hung connections / tasks when a client attempts to open
a named pipe. Using Samba's rpcclient tool:
$ rpcclient //192.168.1.254 -U user%password
$ rpcclient $> srvinfo
<connection hung here>
Kernel side:
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:0 state:D stack:0 pid:5021 tgid:5021 ppid:2 flags:0x00200000
Workqueue: ksmbd-io handle_ksmbd_work
Call trace:
__schedule from schedule+0x3c/0x58
schedule from schedule_preempt_disabled+0xc/0x10
schedule_preempt_disabled from rwsem_down_read_slowpath+0x1b0/0x1d8
rwsem_down_read_slowpath from down_read+0x28/0x30
down_read from ksmbd_session_rpc_method+0x18/0x3c
ksmbd_session_rpc_method from ksmbd_rpc_open+0x34/0x68
ksmbd_rpc_open from ksmbd_session_rpc_open+0x194/0x228
ksmbd_session_rpc_open from create_smb2_pipe+0x8c/0x2c8
create_smb2_pipe from smb2_open+0x10c/0x27ac
smb2_open from handle_ksmbd_work+0x238/0x3dc
handle_ksmbd_work from process_scheduled_works+0x160/0x25c
process_scheduled_works from worker_thread+0x16c/0x1e8
worker_thread from kthread+0xa8/0xb8
kthread from ret_from_fork+0x14/0x38
Exception stack(0x8529ffb0 to 0x8529fff8)
The task deadlocks because the lock is already held:
ksmbd_session_rpc_open
down_write(&sess->rpc_lock)
ksmbd_rpc_open
ksmbd_session_rpc_method
down_read(&sess->rpc_lock) <-- deadlock
Adjust ksmbd_session_rpc_method() callers to take the lock when necessary.
📍 영향받는 시스템
ksmbd 모듈을 사용하는 Linux 커널 버전 (취약한 커밋 포함 버전)
⚔️ 공격 벡터
원격의 공격자가 SMB 프로토콜을 통해 특정 RPC 요청(예: named pipe 오픈)을 보내 시스템 데드락 유도
🛡️ 대응 방법
ksmbd 관련 잠금 로직이 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 취약점이 해결된 최신 패치 버전인지 확인합니다.