CVE-2021-47517: ethtool: do not perform operations on net devices being unregistered
In the Linux kernel, the following vulnerability has been resolved:
ethtool: do not perform operations on net devices being unregistered
The Linux kernel CVE team has assigned CVE-2021-47517 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024052432-CVE-2021-47517-df40@gregkh/T
Other sources
In the Linux kernel, the following vulnerability has been resolved:
ethtool: do not perform operations on net devices being unregistered
There is a short period between a net device starts to be unregistered and when it is actually gone. In that time frame ethtool operations could still be performed, which might end up in unwanted or undefined behaviours[1].
Do not allow ethtool operations after a net device starts its unregistration. This patch targets the netlink part as the ioctl one isn't affected: the reference to the net device is taken and the operation is executed within an rtnl lock section and the net device won't be found after unregister.
[1] For example adding Tx queues after unregister ends up in NULL pointer exceptions and UaFs, such as:
BUG: KASAN: use-after-free in kobjectget+0x14/0x90 Read of size 1 at addr ffff88801961248c by task ethtool/755
CPU: 0 PID: 755 Comm: ethtool Not tainted 5.15.0-rc6+ #778 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-4.fc34 04/014 Call Trace: dumpstacklvl+0x57/0x72 printaddressdescription.constprop.0+0x1f/0x140 kasanreport.cold+0x7f/0x11b kobjectget+0x14/0x90 kobjectaddinternal+0x3d1/0x450 kobjectinitandadd+0xba/0xf0 netdevqueueupdatekobjects+0xcf/0x200 netifsetrealnumtxqueues+0xb4/0x310 vethsetchannels+0x1c3/0x550 ethnlsetchannels+0x524/0x610
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 5.10.87 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 5.15.8 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 5.16 - Compensating control
Prevent ethtool operations on a network device once it starts being unregistered.
Event History
Frequently Asked Questions
What is the severity of CVE-2021-47517?
CVE-2021-47517 has a moderate severity rating due to the potential disruption it can cause during net device unregistration.
How do I fix CVE-2021-47517?
To fix CVE-2021-47517, you should update your Linux kernel to a version that is not vulnerable, such as those after the provided patches.
Which versions are affected by CVE-2021-47517?
CVE-2021-47517 affects Linux kernel versions between 5.6 and 5.10.87 and specific versions between 5.11 and 5.15.8.
What components are impacted by CVE-2021-47517?
CVE-2021-47517 impacts the ethtool operations which may be performed on net devices during their unregistration phase.
Is there a workaround for CVE-2021-47517?
There is no official workaround for CVE-2021-47517; the recommended action is to apply the available security updates.