Article View: linux.kernel.netdev
Article #5704Re: [PATCH net 1/2] ipv6: Hold RCU when emitting route hardware flags notification
From: David Ahern
Date: Tue, 20 Oct 2026 20:31
Date: Tue, 20 Oct 2026 20:31
54 lines
10094 bytes
10094 bytes
On 10/19/26 8:03 AM, Ido Schimmel wrote:
> 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:
> <TASK>
> 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)
> </TASK>
>
> Fixes: 907eea486888 ("net: ipv6: Emit notification when fib hardware flags are changed")
> Reported-by: Sashiko <netdev-bot+sashiko@kernel.org>
> Closes: https://lore.kernel.org/netdev/179152182668.434549.18232968419539498055@kernel.org/
> Assisted-by: LLM
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
> net/ipv6/route.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
Reviewed-by: David Ahern <dsahern@kernel.org>
Technical Details
Message-ID:
<88fc86f6-d096-4e81-b346-29cddf774945@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349558-linux-kernel-netdev=dewy.ruReferences:
<20261019140337.2886875-1-idosch@nvidia.com> <20261019140337.2886875-2-idosch@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349558-linux-kernel-netdev=dewy.ru From: dsahern@kernel.org (David Ahern) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 1/2] ipv6: Hold RCU when emitting route hardware flags notification Date: Tue, 20 Oct 2026 14:31:51 -0600 Organization: Usenet Network Message-ID: <88fc86f6-d096-4e81-b346-29cddf774945@kernel.org> References: <20261019140337.2886875-1-idosch@nvidia.com> <20261019140337.2886875-2-idosch@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="3954036"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:+RWeBn4Vhes9cQWojuRJlmfPlok= sha256:Qh3yv8tkuBbQ4ZW3MlRj5lbwmf7awdbwpSAoFh3v1YU= sha1:MbUfsWWOjmmXAkzJPuRlv4QCR2o= sha256:sd35QwALO0hjxs1N2VGn0G5ALJbuBMnSzoCvaIPwXBY= Content-Language: en-US List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 5998B110E0C; Tue, 20 Oct 2026 23:36:43 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.729 X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 87ShRYg7PaPb; Tue, 20 Oct 2026 23:36:40 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349558-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id B8DC6110DDC; Tue, 20 Oct 2026 23:36:31 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id A74352C4EF; Tue, 20 Oct 2026 20:31:53 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792528313; b=lh/iHmZEJOpHYLU9cpzOHBckHCVIjpB7a/BnPZWT+wIMXr3JwqpUrSlDbAYiX8zIMPvj Zao3cnWGD2F5MXlFLa2yZB7SlRyMyU7GvoI8l2oV6TbRcZO7r8N+SEbf7RKrfm3mwiGuF ABjo0GsUY1e3P/7RKVKHByY7mD6LD0+ePaKY4GW0urDUWBxCRiZIfnAAmZmg1klwkXKG8 YzSYWlsAs2D2nF3hDf2jzneP5f6pz+XT3TRPsCipvwsBOoX4fGRilACwnIjYQThHt1VTr XG8zp5KMUmn22RvYqjmtd9OqIMD8vdkfOW9WuoRdse8vY5fHra8tBoNqzRiPmH5lX0g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792528313; h=X-Original-To:Received:Received:DKIM-Signature:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:Content-Language:To:Cc:References:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=MHafQ+j9a+qjzrbYsK97o5qE4Gd/l3akDGUhkY8tLgg=; b=0B30Uy40iX14uy6F8RTHGdLY9PAIV8Psu/e/26xafjmuBqKmg5mGei5oAGt/XysaAlUE owgnddaIvw4ib0w+D1q0kJd/J+VPfr3g4BfNxDjHvdCSOZ/WOYxETl9WQ3TZnbaesdU/j /EqTdQkvs19n8h15J2080yd9jcdb6DMtDEh6j1T+JurA89zYoNL9Y6iy1FVo5Z89FCtGS 2sbtq2nhOvED7tRy7qiiyK4hcuuwrd8W43IwffZf1rsgE3yR9IyZmtja6IVXBZkuf3uMw xT7/yRx5+/h+OlO++zSPjRIXbcpI45XFDIn5QS/W2ot1kaJaux07hc/1P+TWuoZyGxA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kMT4jAUX; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D87D606A321; Tue, 20 Oct 2026 20:31:53 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kMT4jAUX X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792528312; b=jSbvawyKFKPix+UzFNIaCMzXryqGKuEQIMVOESYHThwV5DBscWOYjdCcht83BDZNjt+e +kfHnKPLkFzAU80MGYPHLAs8rUDuaVXReaSsIMVjVTmzKUooHCtJY76TJB9QueW812PX/ kFy6AVs3r416QJxOQP5ezfvcQu2A6rmDmHDcOu3QG52+sRGIoJbqslPmnLgyXD6RIDhdZ g05J+KPBm7lx4HFLgtn0ATmmcrzUlOtavvttlD7aRndoMXUx/uD8w4r+oBGRrod1tNfuO wmRXFVVDGD3TDL7Ax9lvheQA85oKscxQsPnpOHeEpyam1h9UPxE3vqzrTfnv5zi061A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792528312; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:Content-Language:To:Cc:References:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=MHafQ+j9a+qjzrbYsK97o5qE4Gd/l3akDGUhkY8tLgg=; b=TtRA0pTA4Ti5lMgY1klgQdo5bRvoaUNw1PgTaCCFYjWv2Jn1aBp6afJ8nTYkS6I21naQ 8HaK59XrsuvJYz1V4oznOF96GeW+/5SeXSbYZw5KXJ8zj6danr9ErnDcEHReqYnuoTJM9 oleXwZOVzW5gjeb1AY4CjZ26SpyqgTFsQf3QqxkqSjYlSTZVTwnfOitizeEF4jLzx1HCi IOpxtft0NCwk0bfMeiuqhSHvbOoiyRtyueJ1qrthfh8cjck8H4aBffoEe+j3r8ynUyf6Z 8cw/9zGdbFUsF35KIQHiG2+mSJWOkHs8pkgPtI4zmzM3b/aAuytPkOpArRrI8uaFGlA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kMT4jAUX; arc=none smtp.remote-ip=100.103.45.18 X-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 5DE90606A31A for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 20:31:52 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93AD51F000C9; Tue, 20 Oct 2026 20:31:51 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792528312; bh=MHafQ+j9a+qjzrbYsK97o5qE4Gd/l3akDGUhkY8tLgg=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=kMT4jAUXCnPjhoUPPokodJSTv/gEnxMRbTcp/rIH8jQApJTWkYYoZHsOFjm65gwMd Lm5+06GR70SZj0G2T4BHPATWJtnnJAMOEBSW5HSckLRRokIWbc6bVifOeFZjZGmf00 KWIfaH/dnMGA29nqF4DSwDgqVddFTp0pBj7MlkKHG1DwWvfm8Uy+atImuC6fw9zd77 9q0VOb53XSQy9l7sh+zV3L+XBG1j6bzpGNNA0AjOosWAYnBG2AsNQf6KPHVlvHn9tG 6QeH+jpzajmcKe9uPDjI6p2FEEJXbyK7IfvIqjLlgSm48ChAOROtfkli5u9G0F2bMt Z74GazyMt6Rqw== X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-User-Agent: Mozilla Thunderbird X-Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, horms@kernel.org, andrew+netdev@lunn.ch, petrm@nvidia.com X-In-Reply-To: <20261019140337.2886875-2-idosch@nvidia.com>