From: David Ahern <dsahern@kernel.org>
To: Ido Schimmel <idosch@nvidia.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, petrm@nvidia.com
Subject: Re: [PATCH net-next v2 4/4] nexthop: Fix splat with CONFIG_DEBUG_PREEMPT=y
Date: Mon, 11 Mar 2024 21:28:54 -0600 [thread overview]
Message-ID: <d3f29160-e44e-418e-967c-321b78ffc66b@kernel.org> (raw)
In-Reply-To: <20240311162307.545385-5-idosch@nvidia.com>
On 3/11/24 10:23 AM, Ido Schimmel wrote:
> Locally generated packets can increment the new nexthop statistics from
> process context, resulting in the following splat [1] due to preemption
> being enabled. Fix by using get_cpu_ptr() / put_cpu_ptr() which will
> which take care of disabling / enabling preemption.
>
> BUG: using smp_processor_id() in preemptible [00000000] code: ping/949
> caller is nexthop_select_path+0xcf8/0x1e30
> CPU: 12 PID: 949 Comm: ping Not tainted 6.8.0-rc7-custom-gcb450f605fae #11
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014
> Call Trace:
> <TASK>
> dump_stack_lvl+0xbd/0xe0
> check_preemption_disabled+0xce/0xe0
> nexthop_select_path+0xcf8/0x1e30
> fib_select_multipath+0x865/0x18b0
> fib_select_path+0x311/0x1160
> ip_route_output_key_hash_rcu+0xe54/0x2720
> ip_route_output_key_hash+0x193/0x380
> ip_route_output_flow+0x25/0x130
> raw_sendmsg+0xbab/0x34a0
> inet_sendmsg+0xa2/0xe0
> __sys_sendto+0x2ad/0x430
> __x64_sys_sendto+0xe5/0x1c0
> do_syscall_64+0xc5/0x1d0
> entry_SYSCALL_64_after_hwframe+0x63/0x6b
> [...]
>
> Fixes: f4676ea74b85 ("net: nexthop: Add nexthop group entry stats")
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
> net/ipv4/nexthop.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Reviewed-by: David Ahern <dsahern@kernel.org>
next prev parent reply other threads:[~2024-03-12 3:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 16:23 [PATCH net-next v2 0/4] nexthop: Fix two nexthop group statistics issues Ido Schimmel
2024-03-11 16:23 ` [PATCH net-next v2 1/4] nexthop: Only parse NHA_OP_FLAGS for get messages that require it Ido Schimmel
2024-03-12 3:26 ` David Ahern
2024-03-11 16:23 ` [PATCH net-next v2 2/4] nexthop: Only parse NHA_OP_FLAGS for dump " Ido Schimmel
2024-03-12 3:26 ` David Ahern
2024-03-11 16:23 ` [PATCH net-next v2 3/4] nexthop: Fix out-of-bounds access during attribute validation Ido Schimmel
2024-03-12 3:28 ` David Ahern
2024-03-13 7:58 ` Ido Schimmel
2024-03-11 16:23 ` [PATCH net-next v2 4/4] nexthop: Fix splat with CONFIG_DEBUG_PREEMPT=y Ido Schimmel
2024-03-12 3:28 ` David Ahern [this message]
2024-03-12 3:40 ` [PATCH net-next v2 0/4] nexthop: Fix two nexthop group statistics issues patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d3f29160-e44e-418e-967c-321b78ffc66b@kernel.org \
--to=dsahern@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).