CVE-2026-98311: wifi: virt_wifi: don't transfer operstate before register
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
wifi: virt_wifi: don't transfer operstate before register
virt_wifi_newlink() calls netif_stacked_transfer_operstate() before register_netdevice(). If the lower device is dormant, that queues the new netdev on lweventlist while it is still uninitialized. If registration fails after that, for example because of an invalid name such as "bad/name", free_netdev() immediately frees the object. A later linkwatch_fire_event() then use-after-frees the list entry.
Move the transfer to after netdev_upper_dev_link(), as macvlan and ipvlan already do.
The Linux kernel CVE team has assigned CVE-2026-98311 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.0 with commit c7cdba31ed8b87526db978976392802d3f93110c and fixed in 5.10.271 with commit ee9ea1afd6990def51d52b3a0aecd5cfcc951da0 Issue introduced in 5.0 with commit c7cdba31ed8b87526db978976392802d3f93110c and fixed in 5.15.222 with commit 9ce26201f6dedf3fa02b97da8c67ee6f6c5f7225 Issue introduced in 5.0 with commit c7cdba31ed8b87526db978976392802d3f93110c and fixed in 6.1.189 with commit f9526054c2b2cace5916b7225603d008834ec011 Issue introduced in 5.0 with commit c7cdba31ed8b87526db978976392802d3f93110c and fixed in 6.6.158 with commit e8304e25c6dabb8accf38b807969438d0ce84fd7 Issue introduced in 5.0 with commit c7cdba31ed8b87526db978976392802d3f93110c and fixed in 6.12.112 with commit ca49763c42c1089d654bf11b037980a9ede3772c Issue introduced in 5.0 with commit c7cdba31ed8b87526db978976392802d3f93110c and fixed in 6.18.54 with commit 293c56a66510bb7de073a1aba388e38abddff1fb Issue introduced in 5.0 with commit c7cdba31ed8b87526db978976392802d3f93110c and fixed in 7.2.8 with commit b808a9af5fd21f9c68b0d024eda7535b5dce6a4e Issue introduced in 5.0 with commit c7cdba31ed8b87526db978976392802d3f93110c and fixed in 7.3-rc4 with commit e5c8d7acd31b27057ea42cd405d0b3ece097bc89
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-98311
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/net/wireless/virtual/virt_wifi.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/ee9ea1afd6990def51d52b3a0aecd5cfcc951da0 https://git.kernel.org/stable/c/9ce26201f6dedf3fa02b97da8c67ee6f6c5f7225 https://git.kernel.org/stable/c/f9526054c2b2cace5916b7225603d008834ec011 https://git.kernel.org/stable/c/e8304e25c6dabb8accf38b807969438d0ce84fd7 https://git.kernel.org/stable/c/ca49763c42c1089d654bf11b037980a9ede3772c https://git.kernel.org/stable/c/293c56a66510bb7de073a1aba388e38abddff1fb https://git.kernel.org/stable/c/b808a9af5fd21f9c68b0d024eda7535b5dce6a4e https://git.kernel.org/stable/c/e5c8d7acd31b27057ea42cd405d0b3ece097bc89