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.
Published: 2026-06-24
Score: 5.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

No advisories yet.

History

Thu, 25 Jun 2026 02:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-200

Thu, 25 Jun 2026 00:15:00 +0000

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


Wed, 24 Jun 2026 14:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-200

Wed, 24 Jun 2026 07:45:00 +0000

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

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-06-24T07:14:29.281Z

Reserved: 2026-06-09T07:44:35.370Z

Link: CVE-2026-52940

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Analyzed

Published: 2026-06-24T08:16:24.287

Modified: 2026-07-08T19:12:57.360

Link: CVE-2026-52940

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-06-24T00:00:00Z

Links: CVE-2026-52940 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-12T06:15:04Z

Weaknesses