CVE-2026-31695: Privilege Escalation via UAF in the Linux Kernel

CVE-2026-31695: Privilege Escalation via UAF in the Linux Kernel
Researcher Alexander Popov discovered a vulnerability CVE-2026-31695 in the Linux kernel that allowed an unprivileged user to escalate privileges to root. The flaw had been present in the network device management code for nearly five years. Exploitation relies on a race condition between unregistering a network interface and simultaneously accessing it via the ethtool netlink interface, resulting in use-after-free (UAF).
Vulnerability overview The vulnerability is triggered when two operations on network interfaces execute concurrently: • One thread removes the parent interface veth1 via the RTM_DELLINK message. The kernel calls netdev_run_todo(), which frees the net_device structure associated with veth1. • At the same time, another thread executes the ETHTOOL_MSG_FEATURES_SET command for the child interface virt_wifi0. The ethnl_ops_begin() function calls pm_runtime_get_sync(dev->dev.parent), where dev->dev.parent points to a struct device embedded in the already freed net_device structure for veth1. This results in a use-after-free. The pm_runtime_get_sync() function performs read and write operations on the freed memory, providing the attacker with an exploitation primitive.
Exploitation mechanics • Forging a fake struct device. The UAF is exploited through type confusion: immediately after the memory occupied by veth1, attacker-controlled data is allocated in the same memory region (kmalloc-cg-4k), which the kernel then interprets as a struct device. The pm_runtime_get_sync() function operates on this fake object. • Bypassing protections. Modern kernels enable CONFIG_SLAB_BUCKETS and CONFIG_RANDOM_KMALLOC_CACHES, which make heap spraying and controlled object reallocation more difficult. A cross-cache attack was not a viable option because the race window was too short to perform it. However, the initial UAF does not cause the kernel to crash, allowing the exploitation attempt to be repeated. • Race stabilization. To reliably hit the race window, 512 threads are created, each executing ETHTOOL_MSG_FEATURES_SET. These threads compete for the rtnl_mutex in ethnl_set_features(). Some end up acquiring the lock later, giving the attacker enough time to reallocate the freed memory with a fake struct device before the UAF occurs. This makes exploitation 100% reliable in the test configuration — Fedora 44 Server running on the x86_64 architecture.
Vulnerabilities
Products