🇰🇷 한글 설명
Linux 커널의 IPv6 IOAM 구현에서 skb_ensure_writable() 호출 시 데이터 버퍼가 재할당될 수 있음에도 불구하고 hdr 포인터를 갱신하지 않아 발생하는 취약점입니다. 이로 인해 이미 해제된 메모리 영역을 참조하는 Use-After-Free(UaF) 문제가 발생할 수 있습니다.
💡 쉬운 설명
데이터를 저장하는 메모리 공간이 바뀌었는데, 프로그램이 예전 주소를 계속 사용하려고 해서 발생하는 오류입니다. 이로 인해 시스템이 충돌하거나 해커가 시스템 권한을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ipv6: ioam: refresh hdr pointer before ioam6_event()
Reported by Sashiko:
In ipv6_hop_ioam(), the hdr pointer is initialized to point into the
skb's linear data buffer. Later, the code calls skb_ensure_writable(),
which might reallocate the buffer:
if (skb_ensure_writable(skb, optoff + 2 + hdr->opt_len))
goto drop;
/* Trace pointer may have changed */
trace = (struct ioam6_trace_hdr *)(skb_network_header(skb)
+ optoff + sizeof(*hdr));
ioam6_fill_trace_data(skb, ns, trace, true);
ioam6_event(IOAM6_EVENT_TRACE, dev_net(skb->dev),
GFP_ATOMIC, (void *)trace, hdr->opt_len - 2);
If the skb is cloned or lacks sufficient linear headroom,
skb_ensure_writable() will invoke pskb_expand_head(), which reallocates
the skb's data buffer and frees the old one, invalidating pointers to
it. While the code recalculates the trace pointer immediately after the
call to skb_ensure_writable(), it fails to recalculate the hdr pointer.
This patch fixes the above by recalculating the hdr pointer before
passing hdr->opt_len to ioam6_event(), so that we avoid any UaF.
📍 영향받는 시스템
Linux Kernel (IPv6 IOAM 기능이 활성화된 버전)
⚔️ 공격 벡터
조작된 IPv6 IOAM 패킷을 전송하여 메모리 재할당 및 Use-After-Free 유도
🛡️ 대응 방법
해당 취약점이 수정된 최신 Linux 커널 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 패치된 최신 보안 업데이트 버전인지 확인