🇰🇷 한글 설명
Linux 커널의 tun 드라이버에서 tun_put_user() 함수가 스택에 선언된 virtio_net_hdr_v1_hash_tunnel 구조체를 초기화하지 않아 발생하는 취약점입니다. 비특권 사용자가 vnet 헤더 크기를 조절함으로써 커널 스택에 남아있는 14바이트의 쓰레기 데이터를 유출할 수 있습니다.
💡 쉬운 설명
컴퓨터의 임시 저장 공간(스택)에 남아있던 민감한 정보가 네트워크 패킷을 통해 외부로 새어나갈 수 있는 보안 결함입니다. 해커는 이를 통해 시스템 내부의 중요한 정보를 조금씩 훔쳐볼 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tun: zero the whole vnet header in tun_put_user()
tun_put_user() declares an on-stack struct virtio_net_hdr_v1_hash_tunnel
without zeroing it. For a non-tunnel skb, virtio_net_hdr_tnl_from_skb()
only initializes the first 10 bytes (sizeof(struct virtio_net_hdr)),
leaving bytes 10..23 (num_buffers and the hash/tunnel fields) as stack
garbage.
An unprivileged user can set the vnet header size to 24 with
TUNSETVNETHDRSZ, so __tun_vnet_hdr_put() copies all 24 bytes of the
partially-initialized struct to userspace, leaking 14 bytes of kernel
stack on every read of a non-tunnel packet.
Fix it the same way tun_get_user() already does by zeroing the whole
header right after declaration.
📍 영향받는 시스템
Linux kernel (tun driver 포함 버전)
⚔️ 공격 벡터
비특권 사용자가 TUNSETVNETHDRSZ를 사용하여 헤더 크기를 조작한 후 비터널링 패킷을 읽어 커널 스택 정보를 유출
🛡️ 대응 방법
tun_put_user() 함수 내에서 구조체 선언 직후 전체를 0으로 초기화하도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.