* [PATCH bpf-next] kernel/bpf/verifier: fix build when NET is not enabled
@ 2020-10-07 2:16 Randy Dunlap
2020-10-07 6:12 ` Yonghong Song
2020-10-07 18:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Randy Dunlap @ 2020-10-07 2:16 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, Alexei Starovoitov, Daniel Borkmann, netdev, bpf,
Martin KaFai Lau, linux-next
Fix build errors in kernel/bpf/verifier.c when CONFIG_NET is
not enabled.
../kernel/bpf/verifier.c:3995:13: error: ‘btf_sock_ids’ undeclared here (not in a function); did you mean ‘bpf_sock_ops’?
.btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON],
../kernel/bpf/verifier.c:3995:26: error: ‘BTF_SOCK_TYPE_SOCK_COMMON’ undeclared here (not in a function); did you mean ‘PTR_TO_SOCK_COMMON’?
.btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON],
Fixes: 1df8f55a37bd ("bpf: Enable bpf_skc_to_* sock casting helper to networking prog type")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: netdev@vger.kernel.org
Cc: bpf@vger.kernel.org
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: linux-next@vger.kernel.org
---
First reported by me in linux-next-20200928.
kernel/bpf/verifier.c | 4 ++++
1 file changed, 4 insertions(+)
--- mmotm-2020-1006-1550.orig/kernel/bpf/verifier.c
+++ mmotm-2020-1006-1550/kernel/bpf/verifier.c
@@ -3984,6 +3984,7 @@ static const struct bpf_reg_types sock_t
},
};
+#ifdef CONFIG_NET
static const struct bpf_reg_types btf_id_sock_common_types = {
.types = {
PTR_TO_SOCK_COMMON,
@@ -3994,6 +3995,7 @@ static const struct bpf_reg_types btf_id
},
.btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON],
};
+#endif
static const struct bpf_reg_types mem_types = {
.types = {
@@ -4037,7 +4039,9 @@ static const struct bpf_reg_types *compa
[ARG_PTR_TO_CTX] = &context_types,
[ARG_PTR_TO_CTX_OR_NULL] = &context_types,
[ARG_PTR_TO_SOCK_COMMON] = &sock_types,
+#ifdef CONFIG_NET
[ARG_PTR_TO_BTF_ID_SOCK_COMMON] = &btf_id_sock_common_types,
+#endif
[ARG_PTR_TO_SOCKET] = &fullsock_types,
[ARG_PTR_TO_SOCKET_OR_NULL] = &fullsock_types,
[ARG_PTR_TO_BTF_ID] = &btf_ptr_types,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] kernel/bpf/verifier: fix build when NET is not enabled
2020-10-07 2:16 [PATCH bpf-next] kernel/bpf/verifier: fix build when NET is not enabled Randy Dunlap
@ 2020-10-07 6:12 ` Yonghong Song
2020-10-07 18:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2020-10-07 6:12 UTC (permalink / raw)
To: Randy Dunlap, linux-kernel
Cc: Alexei Starovoitov, Daniel Borkmann, netdev, bpf,
Martin KaFai Lau, linux-next
On 10/6/20 7:16 PM, Randy Dunlap wrote:
> Fix build errors in kernel/bpf/verifier.c when CONFIG_NET is
> not enabled.
>
> ../kernel/bpf/verifier.c:3995:13: error: ‘btf_sock_ids’ undeclared here (not in a function); did you mean ‘bpf_sock_ops’?
> .btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON],
>
> ../kernel/bpf/verifier.c:3995:26: error: ‘BTF_SOCK_TYPE_SOCK_COMMON’ undeclared here (not in a function); did you mean ‘PTR_TO_SOCK_COMMON’?
> .btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON],
>
> Fixes: 1df8f55a37bd ("bpf: Enable bpf_skc_to_* sock casting helper to networking prog type")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: netdev@vger.kernel.org
> Cc: bpf@vger.kernel.org
> Cc: Martin KaFai Lau <kafai@fb.com>
> Cc: linux-next@vger.kernel.org
Acked-by: Yonghong Song <yhs@fb.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] kernel/bpf/verifier: fix build when NET is not enabled
2020-10-07 2:16 [PATCH bpf-next] kernel/bpf/verifier: fix build when NET is not enabled Randy Dunlap
2020-10-07 6:12 ` Yonghong Song
@ 2020-10-07 18:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-10-07 18:00 UTC (permalink / raw)
To: Randy Dunlap; +Cc: linux-kernel, ast, daniel, netdev, bpf, kafai, linux-next
Hello:
This patch was applied to bpf/bpf-next.git (refs/heads/master):
On Tue, 6 Oct 2020 19:16:13 -0700 you wrote:
> Fix build errors in kernel/bpf/verifier.c when CONFIG_NET is
> not enabled.
>
> ../kernel/bpf/verifier.c:3995:13: error: ‘btf_sock_ids’ undeclared here (not in a function); did you mean ‘bpf_sock_ops’?
> .btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON],
>
> ../kernel/bpf/verifier.c:3995:26: error: ‘BTF_SOCK_TYPE_SOCK_COMMON’ undeclared here (not in a function); did you mean ‘PTR_TO_SOCK_COMMON’?
> .btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON],
>
> [...]
Here is the summary with links:
- [bpf-next] kernel/bpf/verifier: fix build when NET is not enabled
https://git.kernel.org/bpf/bpf-next/c/49a2a4d4163f
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] 3+ messages in thread
end of thread, other threads:[~2020-10-07 18:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 2:16 [PATCH bpf-next] kernel/bpf/verifier: fix build when NET is not enabled Randy Dunlap
2020-10-07 6:12 ` Yonghong Song
2020-10-07 18:00 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.