Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-26804 Overview
CVE-2024-26804 is a use-after-free vulnerability [CWE-416] in the Linux kernel's IP tunnel infrastructure, specifically within net/ipv4/ip_tunnel.c. The flaw occurs when the dev->needed_headroom value grows unbounded due to recursive tunnel encapsulation between GRE and IPIP devices. When the headroom exceeds 64KB, the skb->network_header field (a u16) wraps around, causing skb_network_offset() to return a negative value. The subsequent __skb_pull() call treats this negative offset as a large unsigned integer, pushing skb->data outside the allocated skb->head region. The issue was discovered through syzkaller fuzzing and affects Linux kernel versions through 6.8-rc6.
Critical Impact
Local attackers with the ability to configure network tunnels can trigger kernel memory corruption, leading to denial of service or potential privilege escalation on affected Linux systems.
Affected Products
- Linux Kernel (multiple stable branches through 6.8-rc6)
- Debian Linux 10.0
- Distributions shipping unpatched kernels with ip_tunnel support
Discovery Timeline
- 2024-04-04 - CVE-2024-26804 published to NVD
- 2026-08-12 - Last updated in NVD database
Technical Details for CVE-2024-26804
Vulnerability Analysis
The vulnerability resides in the ip_tunnel_xmit() function in net/ipv4/ip_tunnel.c. The function updates a tunnel device's needed_headroom based on the output route's device headroom requirements. When two tunnel devices (for example, gre0 and ipip0) route encapsulated traffic through one another, each transmission path increments the peer device's needed_headroom based on the already-inflated value from the previous packet.
Each subsequent packet causes pskb_expand_head() to reallocate progressively larger headroom. Once the distance between skb->head and skb->data exceeds 65,535 bytes, the 16-bit skb->network_header field overflows. KASAN detects the resulting out-of-bounds access in __skb_flow_dissect() at line 1170 of net/core/flow_dissector.c.
Root Cause
The root cause is the absence of an upper bound on dev->needed_headroom updates during recursive tunnel encapsulation. The 16-bit header offset fields in struct sk_buff cannot represent offsets greater than 65,535 bytes. When skb_network_offset() wraps to a negative value and is passed to __skb_pull() as an unsigned argument, the resulting pointer arithmetic moves skb->data far beyond the allocated buffer, producing a use-after-free condition on the next memory access.
Attack Vector
Exploitation requires local access with CAP_NET_ADMIN to configure the tunnel topology. The reproducer configures a GRE tunnel whose route points at an IPIP tunnel, and arranges the IPIP tunnel's next hop back through the GRE device. Transmitting packets through this loop triggers unbounded headroom growth. Once wrap-around occurs, the kernel reads from freed or unmapped memory in __skb_flow_dissect(), enabling denial of service and creating conditions for memory disclosure or further exploitation.
No verified public exploit code is available. Refer to the upstream commit 5ae1e9922bbd and related stable backports for the exact code change.
Detection Methods for CVE-2024-26804
Indicators of Compromise
- KASAN kernel reports containing use-after-free in __skb_flow_dissect or references to net/core/flow_dissector.c:1170
- Kernel oops or panic messages originating from ip_tunnel_xmit or ipip_tunnel_xmit
- Unexpected growth of needed_headroom values on IP tunnel devices observed via ip -d link show
Detection Strategies
- Monitor /var/log/kern.log and dmesg output for KASAN splats, soft lockups, or crashes referencing the IP tunnel transmit path
- Audit tunnel configurations for recursive routing patterns where two tunnel devices reference each other as next hops
- Deploy runtime kernel integrity monitoring to flag anomalous sk_buff allocation patterns and repeated pskb_expand_head reallocations
Monitoring Recommendations
- Collect kernel logs centrally and alert on signatures matching KASAN, BUG:, or general protection fault entries tied to networking subsystems
- Track CAP_NET_ADMIN grants and ip tunnel, ip link add type gre, and ip link add type ipip command executions on production hosts
- Correlate crash telemetry with tunnel device configuration changes to identify abuse attempts
How to Mitigate CVE-2024-26804
Immediate Actions Required
- Apply the Linux kernel stable updates containing the upstream fix to all affected systems
- Restrict CAP_NET_ADMIN to trusted administrators and remove it from unprivileged containers and user namespaces where feasible
- Audit existing tunnel configurations and remove recursive routing paths between GRE and IPIP devices
Patch Information
The fix caps dev->needed_headroom updates at an upper limit to prevent perpetual growth. Patches are available in the following upstream commits: 5ae1e9922bbd, 049d7989c67e, 2e95350fe9db, a0a1db40b23e, ab63de24ebea, afec0c5cd2ed, and f81e94d2dcd2. Debian users should consult the Debian LTS Announcement for distribution-specific packages.
Workarounds
- Disable IP tunnel modules (ipip, ip_gre) using modprobe -r or blacklisting when they are not required for workload connectivity
- Prevent unprivileged user namespace creation by setting kernel.unprivileged_userns_clone=0 to limit who can create tunnel devices
- Validate routing tables to ensure encapsulated traffic from one tunnel does not egress through another tunnel on the same host
# Blacklist unused IP tunnel modules and disable unprivileged user namespaces
echo 'blacklist ipip' | sudo tee /etc/modprobe.d/blacklist-ipip.conf
echo 'blacklist ip_gre' | sudo tee /etc/modprobe.d/blacklist-ipgre.conf
sudo sysctl -w kernel.unprivileged_userns_clone=0
# Inspect tunnel device headroom and routing
ip -d link show type gre
ip -d link show type ipip
ip route show table all | grep -E 'gre|ipip'
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

