Skip to main content
Vulnerability Database/CVE-2024-35886

CVE-2024-35886: Linux Kernel IPv6 Stack Overflow DoS Flaw

CVE-2024-35886 is a denial of service flaw in Linux Kernel that causes infinite recursion in IPv6 routing, leading to stack overflow crashes. This article covers technical details, affected versions, impact, and mitigation.

Published:

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-35886 Overview

CVE-2024-35886 is a Linux kernel vulnerability in the IPv6 networking subsystem. The flaw triggers infinite recursion in fib6_dump_done() during netlink socket destruction. A local attacker can exploit the issue through crafted AF_UNSPEC RTM_GETROUTE netlink messages combined with memory allocation failures. The recursion exhausts the kernel stack and hits the stack guard page, causing a kernel panic. The bug was discovered by syzkaller fuzzing and affects multiple Linux kernel versions. Debian Linux 10 and Siemens industrial products are also impacted. The vulnerability is classified under [CWE-674] (Uncontrolled Recursion).

Critical Impact

Local attackers can trigger kernel stack exhaustion through netlink socket manipulation, causing denial of service and potential memory corruption of kernel structures.

Affected Products

  • Linux kernel (multiple versions from 2.6.12 through 6.9-rc2)
  • Debian Linux 10
  • Siemens industrial products referenced in advisory SSA-265688

Discovery Timeline

  • 2024-05-19 - CVE-2024-35886 published to NVD
  • 2026-10-15 - Last updated in NVD database

Technical Details for CVE-2024-35886

Vulnerability Analysis

The vulnerability resides in the IPv6 FIB (Forwarding Information Base) dump mechanism in net/ipv6/ip6_fib.c. When userspace sends an AF_UNSPEC RTM_GETROUTE netlink request, the kernel dispatches rtnl_dump_all() which eventually invokes inet6_dump_fib(). This function registers fib6_dump_done() as the completion callback via nlk_sk(sk)->cb.done.

Subsequent calls to inet6_dump_fib() store the previous callback pointer in nlk_sk(sk)->cb.args[3]. During cleanup, fib6_dump_done() calls fib6_dump_end(), which rewrites cb.done with the value stored in cb.args[3]. When both pointers reference fib6_dump_done(), the function recursively invokes itself without a terminating condition.

Root Cause

The root cause is improper ordering of destructor registration in inet6_dump_fib(). The callback destructor is assigned before the kzalloc() allocation for the dump context. When allocation fails, for example under memory pressure or fault injection, the destructor remains set to fib6_dump_done() while cb.args[3] is also populated with the same function pointer, creating the recursive loop.

Attack Vector

Exploitation requires local access and the ability to open netlink route sockets. An attacker sends an AF_UNSPEC RTM_GETROUTE netlink message, then issues a recvmmsg() call to resume the dump. If the kernel encounters an allocation failure during the dump sequence, the netlink socket destructor triggers unbounded recursion of fib6_dump_done(). The call chain exhausts the kernel stack, hitting the stack guard page and generating a kernel oops. The fix moves the destructor assignment to occur after the successful kzalloc(), breaking the recursive condition.

See the upstream kernel commit for the complete patch.

Detection Methods for CVE-2024-35886

Indicators of Compromise

  • Kernel panic messages containing BUG: TASK stack guard page was hit with fib6_dump_done in the call trace
  • Repeated fib6_dump_done entries in kernel stack traces indicating recursion
  • netlink_sock_destruct_work workqueue crashes in kernel logs
  • Unexpected system reboots or soft lockups on hosts processing netlink route dumps

Detection Strategies

  • Monitor dmesg and /var/log/kern.log for stack guard page violations referencing IPv6 FIB functions
  • Correlate netlink socket activity from unprivileged processes with subsequent kernel crashes
  • Track processes making frequent AF_UNSPEC RTM_GETROUTE requests via auditd rules on the recvmmsg syscall
  • Compare installed kernel versions against the fixed commit hashes published by kernel.org

Monitoring Recommendations

  • Enable kernel crash dump collection with kdump to capture stack traces for post-incident analysis
  • Deploy host telemetry that forwards kernel ring buffer contents to centralized logging
  • Alert on anomalous netlink socket creation patterns from non-root user contexts
  • Review Siemens advisory SSA-265688 for OT environments and monitor affected industrial systems

How to Mitigate CVE-2024-35886

Immediate Actions Required

  • Apply the stable kernel updates referenced in the kernel.org commits for your kernel branch
  • Update Debian 10 systems using the fixes from Debian LTS announcements DLA-3817 and DLA-3820
  • Review the Siemens Security Advisory SSA-265688 for affected industrial products
  • Restrict local shell access on multi-tenant systems until patches are deployed

Patch Information

The upstream fix reorders destructor registration in inet6_dump_fib() so cb.done is only set after kzalloc() succeeds. Mainline fix commits include 4a7c465a5dcd, 167d4b47a9bd, 40a344b2ddc0, 9472d07cd095, 9c52581961 82, d21d40605bca, f2dd75e57285, and fd307f2d91d4. Reference the kernel.org stable tree for the complete patch set across supported branches.

Workarounds

  • No official workaround exists; patching the kernel is the only reliable remediation
  • Limit CAP_NET_ADMIN and netlink socket access via Linux capabilities and seccomp filters
  • Deploy namespace isolation to reduce exposure from untrusted local workloads
  • Monitor kernel logs for early signs of exploitation while patches are being staged
bash
# Verify installed kernel version against fixed releases
uname -r

# Debian/Ubuntu: apply available kernel updates
sudo apt update && sudo apt upgrade linux-image-$(uname -r | cut -d- -f3-)
sudo reboot

# RHEL/CentOS/Fedora
sudo dnf update kernel
sudo reboot

# Restrict netlink access via seccomp policy for untrusted services
# (example: deny AF_NETLINK socket creation in a systemd unit)
# SystemCallFilter=~socket
# RestrictAddressFamilies=~AF_NETLINK

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.