CVE-2026-52940 tun: zero the whole vnet header in tun_put_user()
An unprivileged user can leak 14 bytes of kernel stack memory by reading non-tunnel packets via the tun driver.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-52940?
CVE-2026-52940 is a medium-severity vulnerability in Linux kernel, published on 24 Jun 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
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.
Which versions are affected by CVE-2026-52940?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2026-52940?
Apply the vendor's patch.
Is CVE-2026-52940 being exploited?
There is no known exploitation of CVE-2026-52940 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2026-52940, DEBIAN-CVE-2026-52940, GHSA-7mf5-pgq8-jhcp, UBUNTU-CVE-2026-52940.