* Re: [PATCH net] netkit: Assign missing bpf_net_context
2024-09-12 15:56 [PATCH net] netkit: Assign missing bpf_net_context Breno Leitao
@ 2024-09-13 9:08 ` Toke Høiland-Jørgensen
2024-09-13 9:15 ` Nikolay Aleksandrov
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2024-09-13 9:08 UTC (permalink / raw)
To: Breno Leitao, kuba, bpf, Daniel Borkmann, Nikolay Aleksandrov,
David S. Miller, Eric Dumazet, Paolo Abeni, Alexei Starovoitov,
Jesper Dangaard Brouer, Sebastian Andrzej Siewior
Cc: vadim.fedorenko, andrii,
open list:BPF [NETKIT] (BPF-programmable network device),
open list
Breno Leitao <leitao@debian.org> writes:
> During the introduction of struct bpf_net_context handling for
> XDP-redirect, the netkit driver has been missed, which also requires it
> because NETKIT_REDIRECT invokes skb_do_redirect() which is accessing the
> per-CPU variables. Otherwise we see the following crash:
>
> BUG: kernel NULL pointer dereference, address: 0000000000000038
> bpf_redirect()
> netkit_xmit()
> dev_hard_start_xmit()
>
> Set the bpf_net_context before invoking netkit_xmit() program within the
> netkit driver.
>
> Fixes: 401cb7dae813 ("net: Reference bpf_redirect_info via task_struct on PREEMPT_RT.")
> Signed-off-by: Breno Leitao <leitao@debian.org>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH net] netkit: Assign missing bpf_net_context
2024-09-12 15:56 [PATCH net] netkit: Assign missing bpf_net_context Breno Leitao
2024-09-13 9:08 ` Toke Høiland-Jørgensen
@ 2024-09-13 9:15 ` Nikolay Aleksandrov
2024-09-13 17:24 ` Martin KaFai Lau
2024-09-14 3:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Nikolay Aleksandrov @ 2024-09-13 9:15 UTC (permalink / raw)
To: Breno Leitao, kuba, bpf, Daniel Borkmann, David S. Miller,
Eric Dumazet, Paolo Abeni, Alexei Starovoitov,
Toke Høiland-Jørgensen, Jesper Dangaard Brouer,
Sebastian Andrzej Siewior
Cc: vadim.fedorenko, andrii,
open list:BPF [NETKIT] (BPF-programmable network device),
open list
On 9/12/24 18:56, Breno Leitao wrote:
> During the introduction of struct bpf_net_context handling for
> XDP-redirect, the netkit driver has been missed, which also requires it
> because NETKIT_REDIRECT invokes skb_do_redirect() which is accessing the
> per-CPU variables. Otherwise we see the following crash:
>
> BUG: kernel NULL pointer dereference, address: 0000000000000038
> bpf_redirect()
> netkit_xmit()
> dev_hard_start_xmit()
>
> Set the bpf_net_context before invoking netkit_xmit() program within the
> netkit driver.
>
> Fixes: 401cb7dae813 ("net: Reference bpf_redirect_info via task_struct on PREEMPT_RT.")
> Signed-off-by: Breno Leitao <leitao@debian.org>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> drivers/net/netkit.c | 3 +++
> 1 file changed, 3 insertions(+)
>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH net] netkit: Assign missing bpf_net_context
2024-09-12 15:56 [PATCH net] netkit: Assign missing bpf_net_context Breno Leitao
2024-09-13 9:08 ` Toke Høiland-Jørgensen
2024-09-13 9:15 ` Nikolay Aleksandrov
@ 2024-09-13 17:24 ` Martin KaFai Lau
2024-09-14 3:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Martin KaFai Lau @ 2024-09-13 17:24 UTC (permalink / raw)
To: Breno Leitao
Cc: kuba, bpf, Daniel Borkmann, Nikolay Aleksandrov, David S. Miller,
Eric Dumazet, Paolo Abeni, Alexei Starovoitov,
Toke Høiland-Jørgensen, Jesper Dangaard Brouer,
Sebastian Andrzej Siewior, vadim.fedorenko, andrii,
open list:BPF [NETKIT] (BPF-programmable network device),
open list
On 9/12/24 8:56 AM, Breno Leitao wrote:
> During the introduction of struct bpf_net_context handling for
> XDP-redirect, the netkit driver has been missed, which also requires it
> because NETKIT_REDIRECT invokes skb_do_redirect() which is accessing the
> per-CPU variables. Otherwise we see the following crash:
>
> BUG: kernel NULL pointer dereference, address: 0000000000000038
> bpf_redirect()
> netkit_xmit()
> dev_hard_start_xmit()
>
> Set the bpf_net_context before invoking netkit_xmit() program within the
> netkit driver.
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] netkit: Assign missing bpf_net_context
2024-09-12 15:56 [PATCH net] netkit: Assign missing bpf_net_context Breno Leitao
` (2 preceding siblings ...)
2024-09-13 17:24 ` Martin KaFai Lau
@ 2024-09-14 3:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-09-14 3:00 UTC (permalink / raw)
To: Breno Leitao
Cc: kuba, bpf, daniel, razor, davem, edumazet, pabeni, ast, toke,
hawk, bigeasy, vadim.fedorenko, andrii, netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 12 Sep 2024 08:56:19 -0700 you wrote:
> During the introduction of struct bpf_net_context handling for
> XDP-redirect, the netkit driver has been missed, which also requires it
> because NETKIT_REDIRECT invokes skb_do_redirect() which is accessing the
> per-CPU variables. Otherwise we see the following crash:
>
> BUG: kernel NULL pointer dereference, address: 0000000000000038
> bpf_redirect()
> netkit_xmit()
> dev_hard_start_xmit()
>
> [...]
Here is the summary with links:
- [net] netkit: Assign missing bpf_net_context
https://git.kernel.org/netdev/net/c/157f29152b61
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread