🇰🇷 한글 설명
Linux 커널의 seg6 모듈에서 SRH 및 IPv6 DA를 수정하기 전에 패킷 데이터의 쓰기 가능 여부를 확인하지 않는 취약점이 발견되었습니다. 이로 인해 클론된 skb(AF_PACKET 소켓 등)와 데이터를 공유하는 경우, 의도치 않게 공유된 패킷 데이터가 수정되어 데이터 무결성이 깨질 수 있습니다.
💡 쉬운 설명
네트워크 패킷을 처리하는 과정에서 복사본을 만든 뒤 원본 데이터를 수정할 때, 복사본의 내용까지 함께 바뀌어 버리는 문제입니다. 이로 인해 네트워크 통신 중에 데이터가 변조될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
seg6: ensure packet data is writable before modifying SRH and IPv6 DA
advance_nextseg() modifies the SRH Segments Left field and the IPv6
destination address without ensuring the packet data is writable.
seg6_next_csid_advance_arg() has the same problem when it advances the
NEXT-C-SID argument in the destination address.
The skb may be cloned, for example by an AF_PACKET socket receiving on
the ingress device. advance_nextseg() and seg6_next_csid_advance_arg()
then write into the packet data shared with the clone. A read from that
socket can return the modified packet instead of the received one. The
simplified path below shows this for advance_nextseg():
__netif_receive_skb_one_core
__netif_receive_skb_core
deliver_skb [orig: users=2, cloned=0]
packet_rcv
skb_clone clone queued to the AF_PACKET socket
consume_skb(orig) [orig: users=1, cloned=1]
ipv6_rcv
ip6_rcv_core skb_share_check: no-op [orig: users=1]
[...]
input_action_end_core
advance_nextseg writes into the data shared with the clone
Call skb_ensure_writable() in advance_nextseg() and in
seg6_next_csid_advance_arg() before they modify the packet data.
skb_ensure_writable() may reallocate skb->head, which invalidates the
pointers into the packet data taken before the call.
advance_nextseg() now returns a valid SRH pointer, or NULL if
skb_ensure_writable() fails.
seg6_next_csid_advance_arg() takes the pointer to the destination
address from the skb after skb_ensure_writable().
On failure, the callers drop the packet with SKB_DROP_REASON_NOMEM.
📍 영향받는 시스템
Linux Kernel (seg6 관련 모듈을 사용하는 버전)
⚔️ 공격 벡터
AF_PACKET 소켓 등을 통해 패킷이 클론된 상태에서 특정 IPv6 확장 헤더 처리가 발생할 때 데이터 변조 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 skb_ensure_writable() 호출이 포함된 수정 사항을 반영해야 합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전 이상인지 확인합니다.