Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795056686; b=TeQj512zbexDZ9t6uFEi6PMBQyf4MoC4yA99d+LPJKxp+5uuo3qqJKih6L1zgbI8gI8H cYh3PtKZgiB+Ib8jvcYqAvIC0RtsPYrj7gKbnq3BaFm6FJ6IDRsAuQSjEY9H8zCg8g9Jq G9e0d0K2M480b1xlbVhXoRcnF5UGmW2ObdROpmrI7Jk2/oxmaUe2Jz43H6fNKFd96zvDg 4aHQTgrC+iv1gLwLQrzWrYlqEp5LHdegquccQJUTFFo6Murn9fXZZn76XMeGpISmAFCS+ YPgtIbWXdTZXqhQXnXaoQZpEJV0+SQJyxqx2ZC22DqWZUKPRqnoVcxykD1kbSHA5NZA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795056686; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=+FhaW2lbiX/DWloSC7vNs11buwm9D1gScpu1vLQ/xVI=; b=xcUze1+tJGALXfnuNpqLLN7NAStoE8iqH8FZpYmH0ttLXWJFlYhTgJZEbNRMyi4Qp4Nq nIehGc5ZjlSYiy6OfJAMF6Z975wmFJcCggMJYkueKaAi/TqYqftC3eet6xkoGWrRtEMum 96mzrp8QTPpKEANcRS/ODhZS2o4M572XU7/v3hmfDPz0myoROZeNI6ljRVKXwZ+qZwYp8 1zvn47PKEq6n0DuRRChUUmo6MuLVZtBav7MRyiNieX87z9hwfcp6gSvzWFL+6h55cqB5e M7oeGu9mJbn0/snO4SbAEeUtpBOEmSspFu9ERASNDtBbyphee3aRgT/8N956jRewJcQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=qIfVh2j7; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40B7F606A31C; Thu, 19 Nov 2026 02:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=qIfVh2j7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AB9F1F000C4; Thu, 19 Nov 2026 02:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795056686; bh=+FhaW2lbiX/DWloSC7vNs11buwm9D1gScpu1vLQ/xVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qIfVh2j7VdrqRrNGbwZ5IHS6HPRboyeIygSvtCg2biMIQ65K0+EjQymwAV2DDcy+R ylER2feHSY+XzhiKO47hwhmtr82JpJOYkz/nPqpLda959m/fRTHjUPxwT1i0lqbhj0 D5wIhP3J9pBHQmdfgWEiObZLVTI2qVCE/mWjUAgg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Ido Schimmel , Eric Dumazet , David Ahern , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 2074/2214] ipv6: Hold RCU when emitting route hardware flags notification Date: Wed, 18 Nov 2026 16:02:30 +0100 Message-ID: <20261118150133.596446009@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150009.797899913@linuxfoundation.org> References: <20261118150009.797899913@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ido Schimmel [ Upstream commit 7c9cb1edaf8fd8e1af25e39741e603500986ef66 ] fib6_info_hw_flags_set() is called by drivers from process context without RTNL or RCU. When the route uses a nexthop object, rt6_nlmsg_size() and rt6_fill_node() access the nexthop's RCU protected nexthop info and group pointers via rcu_dereference_rtnl(), resulting in suspicious RCU usage splats [1]. Fix by holding RCU while sizing and filling the notification, like fib_alias_hw_flags_set() already does. Switch to GFP_ATOMIC for the skb allocation accordingly. Reproducer: # echo "10 0" > /sys/bus/netdevsim/new_device # sysctl -wq net.ipv6.fib_notify_on_flag_change=1 # sysctl -wq net.ipv4.nexthop_compat_mode=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 rcu_dereference_check() usage! [...] Workqueue: events nsim_fib_event_work Call Trace: dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120) lockdep_rcu_suspicious.cold (kernel/locking/lockdep.c:6972) nexthop_for_each_fib6_nh (net/ipv4/nexthop.c:1539 (discriminator 16)) rt6_nlmsg_size (net/ipv6/route.c:5728) fib6_info_hw_flags_set (net/ipv6/route.c:6503) nsim_fib6_rt_add (drivers/net/netdevsim/fib.c:671 drivers/net/netdevsim/fib.c:694) nsim_fib6_rt_insert (drivers/net/netdevsim/fib.c:759) nsim_fib_event_work (drivers/net/netdevsim/fib.c:856 drivers/net/netdevsim/fib.c:889 drivers/net/netdevsim/fib.c:1493) process_one_work (kernel/workqueue.c:3396) worker_thread (kernel/workqueue.c:3479 kernel/workqueue.c:3560) kthread (kernel/kthread.c:436) ret_from_fork (arch/x86/kernel/process.c:158) ret_from_fork_asm (arch/x86/entry/entry_64.S:245) Fixes: 907eea486888 ("net: ipv6: Emit notification when fib hardware flags are changed") Reported-by: Sashiko Closes: https://lore.kernel.org/netdev/179152182668.434549.18232968419539498055@kernel.org/ Signed-off-by: Ido Schimmel Reviewed-by: Eric Dumazet Reviewed-by: David Ahern Link: https://patch.msgid.link/20261019140337.2886875-2-idosch@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv6/route.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 8286e723d56bc..521ee189235dd 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -6270,7 +6270,9 @@ void fib6_info_hw_flags_set(struct net *net, struct fib6_info *f6i, if (!net->ipv6.sysctl.fib_notify_on_flag_change) return; - skb = nlmsg_new(rt6_nlmsg_size(f6i), GFP_KERNEL); + rcu_read_lock(); + + skb = nlmsg_new(rt6_nlmsg_size(f6i), GFP_ATOMIC); if (!skb) { err = -ENOBUFS; goto errout; @@ -6283,10 +6285,13 @@ void fib6_info_hw_flags_set(struct net *net, struct fib6_info *f6i, goto errout; } + rcu_read_unlock(); + rtnl_notify(skb, net, 0, RTNLGRP_IPV6_ROUTE, NULL, GFP_KERNEL); return; errout: + rcu_read_unlock(); rtnl_set_sk_err(net, RTNLGRP_IPV6_ROUTE, err); } EXPORT_SYMBOL(fib6_info_hw_flags_set); -- 2.53.0