2019-10-19 08:04:22

by Yue Haibing

[permalink] [raw]
Subject: [PATCH bpf-next] bpf: Fix build error without CONFIG_NET

If CONFIG_NET is n, building fails:

kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto':
bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto'

Wrap it into a #ifdef to fix this.

Reported-by: Hulk Robot <[email protected]>
Fixes: a7658e1a4164 ("bpf: Check types of arguments passed into helpers")
Signed-off-by: YueHaibing <[email protected]>
---
kernel/trace/bpf_trace.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 52f7e9d..c324089 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -1055,8 +1055,10 @@ raw_tp_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
switch (func_id) {
case BPF_FUNC_perf_event_output:
return &bpf_perf_event_output_proto_raw_tp;
+#ifdef CONFIG_NET
case BPF_FUNC_skb_output:
return &bpf_skb_output_proto;
+#endif
case BPF_FUNC_get_stackid:
return &bpf_get_stackid_proto_raw_tp;
case BPF_FUNC_get_stack:
--
2.7.4



2019-10-19 09:03:41

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpf: Fix build error without CONFIG_NET

On Fri, 18 Oct 2019 18:11:07 +0000
Yonghong Song <[email protected]> wrote:

> On 10/18/19 2:03 AM, YueHaibing wrote:
> > If CONFIG_NET is n, building fails:
> >
> > kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto':
> > bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto'
> >
> > Wrap it into a #ifdef to fix this.
> >
> > Reported-by: Hulk Robot <[email protected]>
> > Fixes: a7658e1a4164 ("bpf: Check types of arguments passed into helpers")
> > Signed-off-by: YueHaibing <[email protected]>
>
> Acked-by: Yonghong Song <[email protected]>

I'm getting ready for another push to Linus. Want me to pull this into
my tree?

-- Steve

2019-10-19 09:04:13

by Yonghong Song

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpf: Fix build error without CONFIG_NET



On 10/18/19 2:03 AM, YueHaibing wrote:
> If CONFIG_NET is n, building fails:
>
> kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto':
> bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto'
>
> Wrap it into a #ifdef to fix this.
>
> Reported-by: Hulk Robot <[email protected]>
> Fixes: a7658e1a4164 ("bpf: Check types of arguments passed into helpers")
> Signed-off-by: YueHaibing <[email protected]>

Acked-by: Yonghong Song <[email protected]>

> ---
> kernel/trace/bpf_trace.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
> index 52f7e9d..c324089 100644
> --- a/kernel/trace/bpf_trace.c
> +++ b/kernel/trace/bpf_trace.c
> @@ -1055,8 +1055,10 @@ raw_tp_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
> switch (func_id) {
> case BPF_FUNC_perf_event_output:
> return &bpf_perf_event_output_proto_raw_tp;
> +#ifdef CONFIG_NET
> case BPF_FUNC_skb_output:
> return &bpf_skb_output_proto;
> +#endif
> case BPF_FUNC_get_stackid:
> return &bpf_get_stackid_proto_raw_tp;
> case BPF_FUNC_get_stack:
>

2019-10-19 09:08:21

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpf: Fix build error without CONFIG_NET

On Fri, 18 Oct 2019 20:46:29 +0200
Daniel Borkmann <[email protected]> wrote:

> It's related to bpf-next, so only bpf-next is appropriate here. We'll
> take it.

OK, thanks!

-- Steve

2019-10-19 09:09:17

by Daniel Borkmann

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpf: Fix build error without CONFIG_NET

On Fri, Oct 18, 2019 at 02:20:25PM -0400, Steven Rostedt wrote:
> On Fri, 18 Oct 2019 18:11:07 +0000
> Yonghong Song <[email protected]> wrote:
> > On 10/18/19 2:03 AM, YueHaibing wrote:
> > > If CONFIG_NET is n, building fails:
> > >
> > > kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto':
> > > bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto'
> > >
> > > Wrap it into a #ifdef to fix this.
> > >
> > > Reported-by: Hulk Robot <[email protected]>
> > > Fixes: a7658e1a4164 ("bpf: Check types of arguments passed into helpers")
> > > Signed-off-by: YueHaibing <[email protected]>
> >
> > Acked-by: Yonghong Song <[email protected]>
>
> I'm getting ready for another push to Linus. Want me to pull this into
> my tree?

It's related to bpf-next, so only bpf-next is appropriate here. We'll
take it.

Thanks,
Daniel

2019-10-19 09:12:28

by Daniel Borkmann

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpf: Fix build error without CONFIG_NET

On Fri, Oct 18, 2019 at 05:03:44PM +0800, YueHaibing wrote:
> If CONFIG_NET is n, building fails:
>
> kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto':
> bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto'
>
> Wrap it into a #ifdef to fix this.
>
> Reported-by: Hulk Robot <[email protected]>
> Fixes: a7658e1a4164 ("bpf: Check types of arguments passed into helpers")
> Signed-off-by: YueHaibing <[email protected]>

Applied, thanks!