🇰🇷 한글 설명
Linux 커널의 ip6_tunnel 모듈에서 ip6_tnl_xmit() 함수가 skb_realloc_headroom()을 사용하여 skb를 교체하는 과정에서 발생하는 취약점입니다. 재할당 후 오류가 발생할 경우 호출자가 이미 해제된 기존 skb 포인터를 참조하게 되어 Use-After-Free(UAF) 문제가 발생할 수 있습니다.
💡 쉬운 설명
네트워크 데이터를 처리하는 과정에서 메모리 주소를 잘못 관리하여, 이미 사용이 끝난 메모리 영역에 다시 접근하려고 시도하는 오류입니다. 이로 인해 시스템이 충돌하거나 보안 공격에 노출될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ip6_tunnel: use skb_cow_head() in ip6_tnl_xmit()
ip6_tnl_xmit() may need to expand headroom before it can push the
outer IPv6 and optional encap headers. It currently does that with
skb_realloc_headroom(), copies skb->sk ownership, consumes the original
skb, and then continues processing with the replacement skb kept only in
its local variable.
That is safe only if the helper cannot fail afterwards. But this helper
still has post-reallocation error exits. collect_md tunnels reject
non-NONE encap after the replacement, and ip6_tnl_encap() can also fail
later. In those cases the helper returns an error to its callers while
the caller still only has the original skb pointer.
Both ip6_tnl_start_xmit() and the IPv6 GRE paths free the caller skb on
error, so they can end up freeing an skb that ip6_tnl_xmit() already
consumed.
Use skb_cow_head() instead. It provides the required headroom and
writability without privately replacing the caller-owned skb, so later
error returns cannot leave callers with a stale pointer.
The Ethernet users, ip6gretap and ip6erspan, clear IFF_TX_SKB_SHARING
and already call skb_cow_head() before entering ip6_tnl_xmit(). They do
not rely on the removed skb_shared() reallocation. This also makes the
IPv6 tunnel path consistent with ip_tunnel_xmit().
📍 영향받는 시스템
Linux Kernel (ip6_tunnel 모듈을 사용하는 IPv6 터널링 환경)
⚔️ 공격 벡터
특수하게 조작된 IPv6 터널링 패킷을 전송하여 커널의 메모리 해제 오류를 유도
🛡️ 대응 방법
skb_realloc_headroom() 대신 skb_cow_head()를 사용하도록 커널 패치를 적용하거나 최신 커널로 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.