🇰🇷 한글 설명
Linux 커널의 vhost/net 구성 요소에서 zerocopy TX 디스크립터 처리 중 참조 횟수(refcount) 관리가 잘못되어 발생하는 취약점입니다. 클론된 skb가 해제되기 전에 vhost 상태가 먼저 해제될 수 있어, 이후 지연된 완료 작업이 이미 해제된 메모리 포인터를 참조하는 Use-After-Free 오류를 유발합니다.
💡 쉬운 설명
네트워크 데이터를 복사하지 않고 전달하는 과정에서 메모리 관리 오류가 발생합니다. 이로 인해 이미 사용이 끝난 메모리 영역에 다시 접근하려고 시도하여 시스템이 충돌하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
vhost/net: complete zerocopy ubufs only once
vhost-net initializes one ubuf_info per outstanding zerocopy TX
descriptor and hands it to the backend socket. The networking stack may
then clone a zerocopy skb before all skb references are released. For
example, batman-adv fragmentation reaches skb_split(), which calls
skb_zerocopy_clone() and increments the same ubuf_info refcount.
vhost_zerocopy_complete() currently treats every ubuf callback as a
completed vhost descriptor. It dereferences ubuf->ctx, writes the
descriptor completion state, and drops the vhost_net_ubuf_ref even when
the callback only releases a cloned skb reference. A backend reset can
therefore wait for and free the vhost_net_ubuf_ref while another cloned
skb still carries the same ubuf_info. A later completion then
dereferences the freed ubufs pointer.
KASAN reports the stale completion as:
BUG: KASAN: slab-use-after-free in vhost_zerocopy_complete+0x1d7/0x1f0
BUG: KASAN: slab-use-after-free in vhost_zerocopy_complete+0x101/0x1f0
vhost_zerocopy_complete
skb_copy_ubufs
__dev_forward_skb2
veth_xmit
The freed object was allocated from vhost_net_ioctl() while setting the
backend and freed through kfree_rcu()/kvfree_rcu_bulk after backend
removal, while delayed skb completion still reached
vhost_zerocopy_complete().
Honor the generic ubuf_info refcount before touching vhost state, and run
the vhost descriptor completion only for the final ubuf reference. This
matches the msg_zerocopy_complete() ownership rule for cloned zerocopy
skbs.
📍 영향받는 시스템
Linux kernel (vhost/net 구성 요소가 포함된 버전)
⚔️ 공격 벡터
네트워크 스택에서 skb_split() 등을 통해 zerocopy skb를 클론하는 특정 네트워크 트래픽 조건 유도
🛡️ 대응 방법
vhost/net의 ubuf_info 참조 횟수 관리 로직이 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인합니다.