CVE-2026-139343: ipv4: use RCU protection in inet_netconf_get_devconf()
In the Linux kernel, the following vulnerability has been resolved:
ipv4: use RCU protection in inetnetconfgetdevconf()
inetnetconfgetdevconf() runs without RTNL. It uses devgetbyindex() and indevget() to pin the device and its indevice while the reply is allocated and filled.
indevget() is not safe for a lockless caller. Since commit 9d40c84cf5bc ("net: devinet: Reduce refcount before grace period"), inetdevdestroy() drops the final reference before the RCU grace period. A reader can load dev->ipptr, then call refcountinc() on a zero refcount after indevfreercu() has been queued, and keep using the indevice once it has been freed.
None of these references are needed. An indevice is freed after an RCU grace period, ipv4devconf is embedded in it, and inetnetconffilldevconf() does not sleep.
Allocate the skb first, then perform the lookup and the fill under rcureadlock(), using devgetbyindexrcu() and indevgetrcu(), like inetnetconfdumpdevconf() already does.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.119 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.65 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.6-1
Event History
Frequently Asked Questions
What conditions are required for this race to occur?
The vulnerable path must run without RTNL while a network device and its associated in_device are being destroyed. A reader can obtain dev->ip_ptr and attempt to increment the in_device reference after its final reference was dropped and RCU freeing has been queued.
What is the resulting failure mode?
The reader can retain and use an in_device after it has been freed, creating a use-after-free condition while filling IPv4 device configuration data.
What does the resolved implementation change?
It allocates the skb before the lookup, then performs the device lookup and configuration fill under rcu_read_lock(). It uses dev_get_by_index_rcu() and __in_dev_get_rcu() rather than taking unsafe references with dev_get_by_index() and in_dev_get().