🇰🇷 한글 설명
Linux 커널의 TIPC 소켓에서 conn_timeout을 0-3 범위로 설정할 수 있으며, SYN이 거부되어 재시도할 때 delay %= (tsk->conn_timeout / 4) 연산에서 0으로 나누기 오류가 발생합니다. 이로 인해 커널 panic이 발생하며 시스템이 중단됩니다.
💡 쉬운 설명
Linux에서 TIPC 통신 채널의 설정값을 매우 작은 수로 지정하면 커널이 0으로 나누려고 시도하여 시스템이 멈춥니다. 로컬 사용자가 의도적으로 설정을 조작하여 시스템 가용성을 무너뜨릴 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tipc: fix divide-by-zero in tipc_sk_filter_connect()
A user can set conn_timeout to any value via
setsockopt(TIPC_CONN_TIMEOUT), including values less than 4. When a
SYN is rejected with TIPC_ERR_OVERLOAD and the retry path in
tipc_sk_filter_connect() executes:
delay %= (tsk->conn_timeout / 4);
If conn_timeout is in the range [0, 3], the integer division yields 0,
and the modulo operation triggers a divide-by-zero exception, causing a
kernel oops/panic.
Fix this by clamping conn_timeout to a minimum of 4 at the point of use
in tipc_sk_filter_connect().
Oops: divide error: 0000 [#1] SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 119 Comm: poc-F144 Not tainted 7.0.0-rc2+
RIP: 0010:tipc_sk_filter_rcv (net/tipc/socket.c:2236 net/tipc/socket.c:2362)
Call Trace:
tipc_sk_backlog_rcv (include/linux/instrumented.h:82 include/linux/atomic/atomic-instrumented.h:32 include/net/sock.h:2357 net/tipc/socket.c:2406)
__release_sock (include/net/sock.h:1185 net/core/sock.c:3213)
release_sock (net/core/sock.c:3797)
tipc_connect (net/tipc/socket.c:2570)
__sys_connect (include/linux/file.h:62 include/linux/file.h:83 net/socket.c:2098)
📍 영향받는 시스템
Linux kernel 7.0.0-rc2 이전, TIPC 모듈이 활성화된 모든 배포판
⚔️ 공격 벡터
로컬 사용자가 setsockopt(TIPC_CONN_TIMEOUT)으로 conn_timeout을 0-3으로 설정 후 TIPC 연결 시도
🛡️ 대응 방법
Linux 커널을 7.0.0-rc2 이후 버전으로 업데이트하거나, conn_timeout을 최소 4로 제한하는 패치 적용
🔧 검증 코드
커널 버전이 7.0.0-rc2 이전이면 'Vulnerable', 이후 버전이면 'Safe'가 표시됩니다.
uname -r | awk -F. '{if($1<7 || ($1==7 && $2==0)) print "Vulnerable"; else print "Safe"}'