CVE-2025-21802 net: hns3: fix oops when unload drivers paralleling
A race condition in the Linux kernel hns3 network driver can cause a system crash when drivers are unloaded in parallel.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-21802?
CVE-2025-21802 is a medium-severity vulnerability in Linux kernel, published on 27 Feb 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
net: hns3: fix oops when unload drivers paralleling
When unload hclge driver, it tries to disable sriov first for each ae_dev node from hnae3_ae_dev_list. If user unloads hns3 driver at the time, because it removes all the ae_dev nodes, and it may cause oops.
But we can't simply use hnae3_common_lock for this. Because in the process flow of pci_disable_sriov(), it will trigger the remove flow of VF, which will also take hnae3_common_lock.
To fixes it, introduce a new mutex to protect the unload process.
Which versions are affected by CVE-2025-21802?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2025-21802?
Apply the vendor's patch.
Is CVE-2025-21802 being exploited?
There is no known exploitation of CVE-2025-21802 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2025-21802, DEBIAN-CVE-2025-21802, GHSA-425c-353w-6mvg, ROOT-OS-UBUNTU-2404-CVE-2025-21802, UBUNTU-CVE-2025-21802.