🇰🇷 한글 설명
Linux 커널의 veth 드라이버에서 XDP 프래그먼트 조정 후 skb 길이 계산이 잘못되는 취약점이 발견되었습니다. 이로 인해 실제 데이터보다 더 많은 양의 메모리가 사용자 공간으로 복사되어 커널 포인터와 같은 민감한 정보가 유출될 수 있습니다.
💡 쉬운 설명
네트워크 데이터를 처리하는 과정에서 데이터의 길이를 잘못 계산하여, 원래 보여주면 안 되는 컴퓨터 내부의 중요한 정보가 외부로 새 나갈 수 있는 문제입니다. 이로 인해 해커가 시스템의 중요한 정보를 훔쳐볼 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
veth: fix skb length accounting after XDP frag adjustment
veth exposes non-linear skb fragments through an xdp_buff. If an XDP
program adjusts the fragment area, veth_xdp_rcv_skb() copies
xdp_frags_size back to skb->data_len but leaves skb->len containing the
old fragment contribution.
After a fragment shrink, this makes skb_headlen() larger than the actual
linear area. In the reproduced UDP receive path, __skb_datagram_iter()
copied 1024 bytes past the actual linear tail to userspace, starting at
struct skb_shared_info. The copied bytes included the affected skb's
nr_frags, xdp_frags_size, and a kernel pointer from
skb_shinfo(skb)->frags[0]. Real packet data was displaced by the same
amount and truncated at the end.
Subtract the old data_len before replacing it and add the new data_len
afterwards, keeping skb->len and skb->data_len synchronized.
Additionally, bpf_xdp_pull_data() can advance data_end while leaving
frags present. The skb is then still non-linear, so the old
__skb_put(skb, off) triggers SKB_LINEAR_ASSERT().
Use skb_set_tail_pointer() and update skb->len explicitly instead,
following bpf_prog_run_generic_xdp(). Unlike __skb_put(),
skb_set_tail_pointer() does not require a linear skb.
A 60000-byte UDP datagram on a veth pair with MTU 64000 was shortened by
1024 bytes from its fragment area. Before the fix, all 10 runs produced
corrupted payloads. After the fix, all 10 runs matched the expected
payload exactly. A forced-tailroom reproducer also exercises
bpf_xdp_pull_data() with frags still present; the old code triggers
SKB_LINEAR_ASSERT(), while this fix passes 10/10 runs.
📍 영향받는 시스템
XDP 및 veth를 사용하는 Linux 커널 버전
⚔️ 공격 벡터
조작된 XDP 프로그램을 통해 veth 인터페이스로 특수하게 구성된 UDP 패킷을 전송하여 메모리 유출 유도
🛡️ 대응 방법
XDP 프래그먼트 조정 시 skb->len과 skb->data_len이 동기화되도록 커널을 최신 패치 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 보안 패치 버전인지 확인