CVE-2025-21701: net: avoid race between device unregistration and ethnl ops
In the Linux kernel, the following vulnerability has been resolved:
net: avoid race between device unregistration and ethnl ops
The following trace can be seen if a device is being unregistered while its number of channels are being modified.
DEBUGLOCKSWARNON(lock->magic != lock) WARNING: CPU: 3 PID: 3754 at kernel/locking/mutex.c:564 mutexlock+0xc8a/0x1120 CPU: 3 UID: 0 PID: 3754 Comm: ethtool Not tainted 6.13.0-rc6+ #771 RIP: 0010:mutexlock+0xc8a/0x1120 Call Trace: <TASK> ethtoolcheckmaxchannel+0x1ea/0x880 ethnlsetchannels+0x3c3/0xb10 ethnldefaultsetdoit+0x306/0x650 genlfamilyrcvmsgdoit+0x1e3/0x2c0 genlrcvmsg+0x432/0x6f0 netlinkrcvskb+0x13d/0x3b0 genlrcv+0x28/0x40 netlinkunicast+0x42e/0x720 netlinksendmsg+0x765/0xc20 syssendto+0x3ac/0x420 x64syssendto+0xe0/0x1c0 dosyscall64+0x95/0x180 entrySYSCALL64afterhwframe+0x76/0x7e
This is because unregisternetdevicemanynotify might run before the rtnl lock section of ethnl operations, eg. setchannels in the above example. In this example the rss lock would be destroyed by the device unregistration path before being used again, but in general running ethnl operations while dismantle has started is not a good idea.
Fix this by denying any operation on devices being unregistered. A check was already there in ethnlopsbegin, but not wide enough.
Note that the same issue cannot be seen on the ioctl version (devethtool) because the device reference is retrieved from within the rtnl lock section there. Once dismantle started, the net device is unlisted and no reference will be found.
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.27-1 - Upgrade
Upgrade
debian/linux-6.1to a version that resolves this vulnerability.Fixed in 6.1.129-1~deb11u1 - Compensating control
In the Linux networking ethtool/ethnl netlink path, deny/abort ethnl operations (e.g., channel modification) on net devices once device unregistration/dismantle has started, to avoid the race between device unregistration (unregister_netdevice_many_notify) and ethnl ops while the number of channels is being modified.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-21701?
CVE-2025-21701 is classified as a moderate severity vulnerability affecting the Linux kernel.
How do I fix CVE-2025-21701?
Fix CVE-2025-21701 by updating the Linux kernel to the latest stable version where the vulnerability has been addressed.
What systems are affected by CVE-2025-21701?
CVE-2025-21701 affects systems running susceptible versions of the Linux kernel, particularly when handling device unregistration.
What potential impact does CVE-2025-21701 have?
CVE-2025-21701 could lead to race conditions, which may affect device registration and stability of the system.
Is CVE-2025-21701 being actively exploited?
As of now, there is no public knowledge that CVE-2025-21701 is being actively exploited in the wild.