🇰🇷 한글 설명
Linux 커널의 SCSI iSCSI TCP 스택에서 발생하는 NULL 포인터 역참조 취약점입니다. 소켓이 해제되는 동시에 sysfs를 통해 해당 소켓에 접근할 경우 커널 크래시가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 네트워크 연결 정보를 확인하려는 순간, 그 연결이 갑자기 끊기면서 시스템이 갈 길을 잃고 멈춰버리는 문제입니다. 이로 인해 시스템이 갑자기 재부팅되거나 중단될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()
Fix a NULL pointer crash that occurs when we are freeing the socket at the
same time we access it via sysfs.
The problem is that:
1. iscsi_sw_tcp_conn_get_param() and iscsi_sw_tcp_host_get_param() take
the frwd_lock and do sock_hold() then drop the frwd_lock. sock_hold()
does a get on the "struct sock".
2. iscsi_sw_tcp_release_conn() does sockfd_put() which does the last put
on the "struct socket" and that does __sock_release() which sets the
sock->ops to NULL.
3. iscsi_sw_tcp_conn_get_param() and iscsi_sw_tcp_host_get_param() then
call kernel_getpeername() which accesses the NULL sock->ops.
Above we do a get on the "struct sock", but we needed a get on the "struct
socket". Originally, we just held the frwd_lock the entire time but in
commit bcf3a2953d36 ("scsi: iscsi: iscsi_tcp: Avoid holding spinlock while
calling getpeername()") we switched to refcount based because the network
layer changed and started taking a mutex in that path, so we could no
longer hold the frwd_lock.
Instead of trying to maintain multiple refcounts, this just has us use a
mutex for accessing the socket in the interface code paths.
📍 영향받는 시스템
Linux Kernel (iSCSI TCP 스택을 사용하는 시스템)
⚔️ 공격 벡터
로컬 공격자가 sysfs를 통해 iSCSI 소켓 파라미터에 빈번하게 접근하여 레이스 컨디션을 유도함으로써 발생
🛡️ 대응 방법
iSCSI TCP 관련 커널 패치가 적용된 최신 버전의 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인