CVE-2026-139242: ipv6: Hold RCU when emitting route hardware flags notification
In the Linux kernel, the following vulnerability has been resolved:
ipv6: Hold RCU when emitting route hardware flags notification
fib6infohwflagsset() is called by drivers from process context without RTNL or RCU. When the route uses a nexthop object, rt6nlmsgsize() and rt6fillnode() access the nexthop's RCU protected nexthop info and group pointers via rcudereferencertnl(), resulting in suspicious RCU usage splats [1].
Fix by holding RCU while sizing and filling the notification, like fibaliashwflagsset() already does. Switch to GFPATOMIC for the skb allocation accordingly.
Reproducer:
# echo "10 0" > /sys/bus/netdevsim/newdevice # sysctl -wq net.ipv6.fibnotifyonflagchange=1 # sysctl -wq net.ipv4.nexthopcompatmode=1 # ip -6 nexthop add id 1 blackhole # ip -6 route add 2001:db8:1::1/128 nhid 1
[1] WARNING: suspicious RCU usage 7.3.0-rc7-virtme-g191aa41548b2 #38 Not tainted net/ipv4/nexthop.c:1539 suspicious rcudereferencecheck() usage! [...] Workqueue: events nsimfibeventwork Call Trace: <TASK> dumpstacklvl (lib/dumpstack.c:94 lib/dumpstack.c:120) lockdeprcususpicious.cold (kernel/locking/lockdep.c:6972) nexthopforeachfib6nh (net/ipv4/nexthop.c:1539 (discriminator 16)) rt6nlmsgsize (net/ipv6/route.c:5728) fib6infohwflagsset (net/ipv6/route.c:6503) nsimfib6rtadd (drivers/net/netdevsim/fib.c:671 drivers/net/netdevsim/fib.c:694) nsimfib6rtinsert (drivers/net/netdevsim/fib.c:759) nsimfibeventwork (drivers/net/netdevsim/fib.c:856 drivers/net/netdevsim/fib.c:889 drivers/net/netdevsim/fib.c:1493) processonework (kernel/workqueue.c:3396) workerthread (kernel/workqueue.c:3479 kernel/workqueue.c:3560) kthread (kernel/kthread.c:436) retfromfork (arch/x86/kernel/process.c:158) retfromforkasm (arch/x86/entry/entry64.S:245) </TASK>
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Hold RCU while sizing and filling the route hardware-flags notification, and use GFP_ATOMIC for the skb allocation.
Event History
Frequently Asked Questions
Which configurations are implicated by the reported reproducer?
The reproducer enables net.ipv6.fib_notify_on_flag_change and net.ipv4.nexthop_compat_mode, creates a netdevsim device, and installs an IPv6 route that references a nexthop object. The problematic notification path is reached when route hardware flags are updated from driver process context.
How might an affected system present?
The reported symptom is a lockdep warning for suspicious RCU usage, originating from nexthop RCU dereference checks while processing the route hardware-flags notification. The example trace runs in the nsim_fib_event_work workqueue.