Skip to main content
Vulnerability Database/CVE-2026-98311

CVE-2026-98311: Linux Kernel Use-After-Free Vulnerability

CVE-2026-98311 is a use-after-free flaw in the Linux kernel virt_wifi module that occurs during network device registration. This post explains the technical details, affected versions, and mitigation steps.

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-2026-98311 Overview

CVE-2026-98311 is a use-after-free vulnerability in the Linux kernel's virt_wifi driver. The flaw exists in virt_wifi_newlink(), which calls netif_stacked_transfer_operstate() before register_netdevice() completes. When the lower device is dormant, the new netdev gets queued on lweventlist while still uninitialized. If registration subsequently fails, for example due to an invalid name such as bad/name, free_netdev() releases the object. A later linkwatch_fire_event() then dereferences the freed list entry.

Critical Impact

A local user with sufficient privileges to create virtual wireless interfaces can trigger a kernel use-after-free, enabling potential privilege escalation or denial of service on affected Linux systems.

Affected Products

  • Linux kernel versions containing the virt_wifi driver with the pre-registration operstate transfer
  • Distributions shipping vulnerable stable kernel branches referenced in the upstream fix commits
  • Systems where unprivileged or namespace-capable users can invoke virt_wifi_newlink()

Discovery Timeline

  • 2026-10-06 - CVE-2026-98311 published to NVD
  • 2026-10-07 - Last updated in NVD database

Technical Details for CVE-2026-98311

Vulnerability Analysis

The virt_wifi driver creates stacked virtual Wi-Fi interfaces on top of an existing lower network device. During link creation, virt_wifi_newlink() invokes netif_stacked_transfer_operstate() to inherit the operational state from the lower device. The call occurs before register_netdevice() finalizes the new interface.

When the lower device is in a dormant state, the operstate transfer path queues the uninitialized child netdev onto the global lweventlist managed by the linkwatch subsystem. The netdev is not yet a registered kernel object at this point.

If register_netdevice() fails afterward, for instance when the caller supplies an invalid interface name such as bad/name that fails validation, the error path calls free_netdev() to immediately release the structure. The stale pointer remains on lweventlist. When the linkwatch worker later runs linkwatch_fire_event(), it dereferences the freed memory, producing a use-after-free condition in kernel context.

Root Cause

The root cause is an ordering defect. The driver performs an operation that can register the netdev with external subsystems before the netdev itself is registered. Analogous drivers such as macvlan and ipvlan perform the operstate transfer after netdev_upper_dev_link(), avoiding the window where a half-constructed object becomes externally visible.

Attack Vector

Exploitation requires local access and the capability to create network interfaces, which is typically granted through CAP_NET_ADMIN within a user namespace. An attacker scripts repeated calls to create a virt_wifi interface over a dormant lower device while supplying an invalid interface name to force registration failure. Successful triggering yields kernel heap corruption, which can be shaped into privilege escalation or at minimum a denial-of-service kernel panic. See the upstream fix at Kernel Commit ca49763c for the corrected ordering.

// No verified exploit code is available. Refer to upstream commits for
// the authoritative patch and reproducer context.

Detection Methods for CVE-2026-98311

Indicators of Compromise

  • Kernel oops or panic messages referencing linkwatch_fire_event, netif_stacked_transfer_operstate, or virt_wifi in dmesg and /var/log/kern.log
  • KASAN reports flagging a use-after-free in the linkwatch worker path
  • Repeated RTM_NEWLINK netlink requests from unprivileged processes targeting the virt_wifi link type with malformed interface names

Detection Strategies

  • Enable KASAN on test and staging kernels to surface the use-after-free when fuzzing or during regression testing
  • Audit kernel version inventory against the fixed commits listed in the upstream references
  • Monitor process execution for tooling such as ip link add combined with virt_wifi type arguments originating from non-administrative user contexts

Monitoring Recommendations

  • Forward kernel ring buffer events to a centralized log pipeline and alert on crash signatures containing virt_wifi or linkwatch
  • Track creation of user namespaces granting CAP_NET_ADMIN to unprivileged workloads
  • Correlate netlink interface creation attempts with subsequent kernel instability within short time windows

How to Mitigate CVE-2026-98311

Immediate Actions Required

  • Apply the upstream stable kernel updates that reorder the operstate transfer to occur after netdev_upper_dev_link()
  • Unload the virt_wifi module on systems that do not require it using modprobe -r virt_wifi and blacklist it going forward
  • Restrict CAP_NET_ADMIN in user namespaces for untrusted workloads and containerized tenants

Patch Information

The fix moves netif_stacked_transfer_operstate() to execute after netdev_upper_dev_link(), matching the pattern already used by macvlan and ipvlan. Backports are available across multiple stable branches. Reference the authoritative fix commits: Kernel Commit 293c56a6, Kernel Commit 9ce26201, Kernel Commit b808a9af, Kernel Commit ca49763c, Kernel Commit e5c8d7ac, Kernel Commit e8304e25, Kernel Commit ee9ea1af, and Kernel Commit f9526054.

Workarounds

  • Blacklist the virt_wifi module by adding blacklist virt_wifi to /etc/modprobe.d/blacklist-virt-wifi.conf
  • Disable unprivileged user namespace creation via sysctl -w kernel.unprivileged_userns_clone=0 on distributions that expose this tunable
  • Apply seccomp or Landlock policies to block RTM_NEWLINK netlink messages from untrusted processes
bash
# Configuration example: block virt_wifi loading and verify
echo "blacklist virt_wifi" | sudo tee /etc/modprobe.d/blacklist-virt-wifi.conf
sudo modprobe -r virt_wifi 2>/dev/null || true
lsmod | grep virt_wifi && echo "module still loaded" || echo "virt_wifi not loaded"

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.