🇰🇷 한글 설명
리눅스 커널의 TCP 스택에서 TIME_WAIT 상태의 ISN(Initial Sequence Number)을 처리할 때 발생하는 정보 유출 취약점입니다. 특정 패킷 드롭 경로에서 per-CPU 변수에 저장된 ISN 값이 제대로 소모되지 않고 남아 있어, 다음 SYN 패킷 처리 시 예측 가능한 ISN이 사용될 수 있습니다.
💡 쉬운 설명
해커가 다음에 올 네트워크 연결 번호를 미리 예측할 수 있게 만드는 보안 결함입니다. 이로 인해 공격자가 정상적인 연결인 것처럼 속여 데이터를 가로채거나 조작할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tcp: fix stale per-CPU tcp_tw_isn leak enabling ISN prediction
Blamed commit moved the TIME_WAIT-derived ISN from the skb control
block to a per-CPU variable, assuming the value would always be consumed
by tcp_conn_request() for the same packet that wrote it. That assumption
is violated by multiple drop paths between the producer
(__this_cpu_write(tcp_tw_isn, isn) in tcp_v{4,6}_rcv()) and the consumer
(tcp_conn_request()):
- min_ttl / min_hopcount check
- xfrm policy check
- tcp_inbound_hash() MD5/AO mismatch
- tcp_filter() eBPF/SO_ATTACH_FILTER drop
- th->syn && th->fin discard in tcp_rcv_state_process() TCP_LISTEN
- psp_sk_rx_policy_check() in tcp_v{4,6}_do_rcv()
- tcp_checksum_complete() in tcp_v{4,6}_do_rcv()
- tcp_v{4,6}_cookie_check() returning NULL
When a packet is dropped on any of these paths, tcp_tw_isn is left set.
The next SYN processed on the same CPU then consumes the non zero value in
tcp_conn_request(), receiving a potentially predictable ISN.
This patch moves back tcp_tw_isn to skb->cb[], getting rid of the per-cpu
variable.
Note that tcp_v{4,6}_fill_cb() do not set it.
Very litle impact on overall code size/complexity:
$ scripts/bloat-o-meter -t vmlinux.old vmlinux.new
add/remove: 0/0 grow/shrink: 2/1 up/down: 8/-15 (-7)
Function old new delta
tcp_v6_rcv 3038 3042 +4
tcp_v4_rcv 3035 3039 +4
tcp_conn_request 2938 2923 -15
Total: Before=24436060, After=24436053, chg -0.00%
📍 영향받는 시스템
ISN 예측 취약점이 포함된 특정 버전의 Linux Kernel
⚔️ 공격 벡터
패킷 드롭을 유도하여 CPU 변수에 남은 이전 ISN 값을 다음 연결에서 재사용하게 만드는 방식
🛡️ 대응 방법
해당 취약점이 수정된 최신 버전의 리눅스 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인