CVE-2026-52940

tun: zero the whole vnet header in tun_put_user()

Published Jun 24, 2026 CVSS 3.1 · 5.5 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The vulnerability resides in the tun subsystem of the Linux kernel. The function tun_put_user() allocates a stack‑based struct virtio_net_hdr_v1_hash_tunnel but only initializes the first 10 bytes for packets that are not tunneled. An attacker can set the virtual network header size to 24 bytes via the TUNSETVNETHDRSZ ioctl, causing the partially initialized 24‑byte structure to be copied into user space on every read of a non‑tunnel packet. Each read leaks 14 bytes of kernel stack memory, providing an unprivileged local user with confidential kernel data that may assist in more advanced attacks.

Affected Systems

Any Linux kernel build that predates commit 585cb85e9a29185be05f326369573c2663cf4380 is susceptible. Those kernels lack the patch that zeroes the entire vnet header before it is sent to user space. Administrators should compare their running kernel version against that commit or install a kernel version that includes the fix.

Risk and Exploitability

The CVSS score is 5.5, reflecting a moderate severity for a local information‑disclosure flaw. The EPSS score of less than 1% indicates a low but non‑zero probability of exploitation. The vulnerability is local and does not require elevated privileges; any user with access to a tun device can trigger the leak. While the flaw itself does not grant arbitrary code execution, the disclosed kernel stack data may aid attackers in discovering additional vulnerabilities or refining exploitation techniques. The issue is not listed in the CISA KEV catalog, but the potential for aiding future exploits warrants timely remediation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the kernel patch that zeroes the entire vnet header in tun_put_user()
  • Upgrade to a Linux kernel version that includes the commit that fixes the issue
  • If a tun interface is not required, disable or remove it to eliminate the attack surface

Generated by OpenCVE AI on August 12, 2026 at 06:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-8726-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8727-1 Linux kernel (OEM) vulnerabilities
Ubuntu USN Ubuntu USN USN-8728-1 Linux kernel (GCP) vulnerabilities
Ubuntu USN Ubuntu USN USN-8760-1 Linux kernel (NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-8726-2 Linux kernel (Raspberry Pi) vulnerabilities
Ubuntu USN Ubuntu USN USN-8726-3 Linux kernel (IBM) vulnerabilities
Ubuntu USN Ubuntu USN USN-8800-1 Linux kernel (NVIDIA BaseOS) vulnerabilities
Ubuntu USN Ubuntu USN USN-8760-2 Linux kernel (NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-8726-4 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8728-2 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-8728-3 Linux kernel (Oracle) vulnerabilities
History
Type Values Removed Values Added
Weaknesses CWE-200
Type Values Removed Values Added
Weaknesses CWE-909
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.0, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-200
Type Values Removed Values Added
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.
Title tun: zero the whole vnet header in tun_put_user()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Jun 24, 2026, 7:14 AM
Reserved
Jun 9, 2026, 7:44 AM
Status
Analyzed
Published
Jun 24, 2026, 8:16 AM
Modified
Jul 8, 2026, 7:12 PM
Severity
Moderate
Public date
Jun 24, 2026, 12:00 AM