🇰🇷 한글 설명
Linux 커널의 tap 드라이버 내 tap_get_user_xdp() 함수에서 virtio-net 헤더를 파싱하기 전에 skb->dev를 설정하지 않아 발생하는 취약점입니다. 특정 조건에서 virtio-net 헤더를 처리하는 과정 중 skb->dev가 NULL인 상태로 참조되어 시스템 충돌(Crash)을 유발할 수 있습니다.
💡 쉬운 설명
네트워크 데이터를 처리하는 과정에서 필요한 정보가 비어있는 상태로 잘못된 명령을 내려 컴퓨터 시스템이 갑자기 멈추거나 꺼질 수 있는 문제입니다. 데이터 처리 순서를 올바르게 조정하여 이 문제를 해결할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: tap: set skb->dev before parsing virtio net header in tap_get_user_xdp()
The commit 4f61f133f354 ("net: tap: NULL pointer derefence in
dev_parse_header_protocol when skb->dev is null") fixed a crash in
tap_get_user() by assigning skb->dev before calling tun_vnet_hdr_to_skb().
This is required because virtio_net_hdr_to_skb() may invoke
dev_parse_header_protocol(), which dereferences skb->dev. Without the
assignment, a NULL pointer dereference can occur.
However, tap_get_user_xdp() still parses the virtio-net header before
assigning skb->dev. When the vhost TX path passes an XDP buffer containing
a GSO virtio-net header but the protocol is set to zero on purpose,
tun_vnet_hdr_to_skb() can reach dev_parse_header_protocol() while skb->dev
is still NULL, resulting in a crash.
Fix this by looking up the tap device and assigning skb->dev before calling
tun_vnet_hdr_to_skb(), matching the ordering already used in
tap_get_user(). Preserve the existing RCU read-side critical section across
dev_queue_xmit().
📍 영향받는 시스템
Linux Kernel (tap driver 관련 버전)
⚔️ 공격 벡터
vhost TX 경로를 통해 특정 프로토콜 설정이 포함된 XDP 버퍼를 전달하여 NULL 포인터 역참조 유도
🛡️ 대응 방법
Linux 커널을 최신 패치가 적용된 버전으로 업데이트하여 tap_get_user_xdp()의 실행 순서 수정 적용
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전 이상인지 확인합니다.