bpf: Remove tst_run from lwt_seg6local_prog_ops.
Subsystems (4)
PATCH 1/1 bpf: Remove tst_run from lwt_seg6local_prog_ops.
The syzbot reported that the lwt_seg6 related BPF ops can be invoked via bpf_test_run() without without entering input_action_end_bpf() first.
Martin KaFai Lau said that self test for BPF_PROG_TYPE_LWT_SEG6LOCAL probably didn't work since it was introduced in commit 04d4b274e2a ("ipv6: sr: Add seg6local action End.BPF"). The reason is that the per-CPU variable seg6_bpf_srh_states::srh is never assigned in the self test case but each BPF function expects it.
Remove test_run for BPF_PROG_TYPE_LWT_SEG6LOCAL.
--- net/core/filter.c | 1 - 1 file changed, 1 deletion(-)
net/core/filter.c +0 -1
@@ -11053,7 +11053,6 @@ const struct bpf_verifier_ops lwt_seg6local_verifier_ops = { };const struct bpf_prog_ops lwt_seg6local_prog_ops = { - .test_run = bpf_prog_test_run_skb, };const struct bpf_verifier_ops cg_sock_verifier_ops = {
Signature · 1 line
2.45.2
Quoted 10 lines · Sebastian Andrzej Siewior
The syzbot reported that the
lwt_seg6related BPF ops can be invoked viabpf_test_run()without without enteringinput_action_end_bpf()first.Martin KaFai Lau said that self test for
BPF_PROG_TYPE_LWT_SEG6LOCALprobably didn't work since it was introduced in commit04d4b274e2a("ipv6: sr: Add seg6local action End.BPF"). The reason is that the per-CPU variableseg6_bpf_srh_states::srhis never assigned in the self test case but each BPF function expects it.
Quoted 5 lines
Remove
test_runforBPF_PROG_TYPE_LWT_SEG6LOCAL.Suggested-by Martin KaFai Lau <[email protected]>Reported-by [email protected]Fixes d1542d4ae4df ("seg6: Use nested-BH locking for seg6_bpf_srh_states.")
We can also add in addition for reference:
Quoted 1 line
Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Martin KaFai Lau
reviewerQuoted 13 lines · Daniel Borkmann
Quoted 12 lines · Sebastian Andrzej Siewior
The syzbot reported that the
lwt_seg6related BPF ops can be invoked viabpf_test_run()without without enteringinput_action_end_bpf()first.Martin KaFai Lau said that self test for
BPF_PROG_TYPE_LWT_SEG6LOCALprobably didn't work since it was introduced in commit04d4b274e2a("ipv6: sr: Add seg6local action End.BPF"). The reason is that the per-CPU variableseg6_bpf_srh_states::srhis never assigned in the self test case but each BPF function expects it.Remove
test_runforBPF_PROG_TYPE_LWT_SEG6LOCAL.
Quoted 7 lines
Quoted 3 lines
Suggested-by Martin KaFai Lau <[email protected]>Reported-by [email protected]Fixes d1542d4ae4df ("seg6: Use nested-BH locking for seg6_bpf_srh_states.")We can also add in addition for reference:
Fixes 004d4b274e2a ("ipv6: sr: Add seg6local action End.BPF")
Added the Fixes tag before applying.
Thanks!
This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:
Quoted 11 lines · On Wed, 10 Jul 2024 16:16:31 +0200 you wrote:
The syzbot reported that the
lwt_seg6related BPF ops can be invoked viabpf_test_run()without without enteringinput_action_end_bpf()first.Martin KaFai Lau said that self test for
BPF_PROG_TYPE_LWT_SEG6LOCALprobably didn't work since it was introduced in commit04d4b274e2a("ipv6: sr: Add seg6local action End.BPF"). The reason is that the per-CPU variableseg6_bpf_srh_states::srhis never assigned in the self test case but each BPF function expects it.[...]
Here is the summary with links:
- [bpf-next] bpf: Remove tst_run from lwt_seg6local_prog_ops.
https://git.kernel.org/bpf/bpf-next/c/c13fda93aca1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html