Re: linux-next: Tree for Sep 18 (kernel/bpf/syscall)

4 messages, 3 authors, 2018-09-18 · open the first message on its own page

Re: linux-next: Tree for Sep 18 (kernel/bpf/syscall)

From: Randy Dunlap <rdunlap@infradead.org>
Date: 2018-09-18 15:37:53

On 9/17/18 10:12 PM, Stephen Rothwell wrote:
Hi all,

Changes since 20180913:

on i386 or x86_64: (in 6 of 20 randconfigs)

kernel/bpf/syscall.o: In function `__x64_sys_bpf':
syscall.c:(.text+0x3278): undefined reference to `skb_flow_dissector_bpf_prog_attach'
syscall.c:(.text+0x3310): undefined reference to `skb_flow_dissector_bpf_prog_detach'
kernel/bpf/syscall.o:(.rodata+0x3f0): undefined reference to `flow_dissector_prog_ops'
kernel/bpf/verifier.o:(.rodata+0x250): undefined reference to `flow_dissector_verifier_ops'


Full randconfig file is attached.

-- 
~Randy

Re: linux-next: Tree for Sep 18 (kernel/bpf/syscall)

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2018-09-18 15:41:16

[ Cc Petar and Willem ]

On 09/18/2018 05:37 PM, Randy Dunlap wrote:
On 9/17/18 10:12 PM, Stephen Rothwell wrote:
quoted
Hi all,

Changes since 20180913:
on i386 or x86_64: (in 6 of 20 randconfigs)

kernel/bpf/syscall.o: In function `__x64_sys_bpf':
syscall.c:(.text+0x3278): undefined reference to `skb_flow_dissector_bpf_prog_attach'
syscall.c:(.text+0x3310): undefined reference to `skb_flow_dissector_bpf_prog_detach'
kernel/bpf/syscall.o:(.rodata+0x3f0): undefined reference to `flow_dissector_prog_ops'
kernel/bpf/verifier.o:(.rodata+0x250): undefined reference to `flow_dissector_verifier_ops'

Full randconfig file is attached.
Looks like we need a wrapper for these, config had:

# CONFIG_NET is not set

Re: linux-next: Tree for Sep 18 (kernel/bpf/syscall)

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2018-09-18 16:28:39

On Tue, Sep 18, 2018 at 11:44 AM Daniel Borkmann [off-list ref] wrote:
[ Cc Petar and Willem ]

On 09/18/2018 05:37 PM, Randy Dunlap wrote:
quoted
On 9/17/18 10:12 PM, Stephen Rothwell wrote:
quoted
Hi all,

Changes since 20180913:
on i386 or x86_64: (in 6 of 20 randconfigs)

kernel/bpf/syscall.o: In function `__x64_sys_bpf':
syscall.c:(.text+0x3278): undefined reference to `skb_flow_dissector_bpf_prog_attach'
syscall.c:(.text+0x3310): undefined reference to `skb_flow_dissector_bpf_prog_detach'
kernel/bpf/syscall.o:(.rodata+0x3f0): undefined reference to `flow_dissector_prog_ops'
kernel/bpf/verifier.o:(.rodata+0x250): undefined reference to `flow_dissector_verifier_ops'

Full randconfig file is attached.
Looks like we need a wrapper for these, config had:

# CONFIG_NET is not set
Thanks for forwarding the report.

For the functions, I think we can use a similar static inline stub as
used e.g., for bpf_map_offload_map_alloc.

The _ops references are from a macro that includes linux/bpf_types.h,
so indeed a CONFIG looks needed.

I need to look it over before I send out, but tentative patch:
diff --git a/include/linux/bpf_types.h b/include/linux/bpf_types.h
index 22083712dd18..f57fa5a6be8f 100644
--- a/include/linux/bpf_types.h
+++ b/include/linux/bpf_types.h
@@ -32,7 +32,9 @@ BPF_PROG_TYPE(BPF_PROG_TYPE_LIRC_MODE2, lirc_mode2)
 #ifdef CONFIG_INET
 BPF_PROG_TYPE(BPF_PROG_TYPE_SK_REUSEPORT, sk_reuseport)
 #endif
+#ifdef CONFIG_NET
 BPF_PROG_TYPE(BPF_PROG_TYPE_FLOW_DISSECTOR, flow_dissector)
+#endif

 BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops)
 BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_ARRAY, percpu_array_map_ops)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ce0e863f02a2..d26a21f10cec 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1194,10 +1194,23 @@ void skb_flow_dissector_init(struct
flow_dissector *flow_dissector,
                             const struct flow_dissector_key *key,
                             unsigned int key_count);

+#if defined(CONFIG_NET) && defined(CONFIG_BPF_SYSCALL)
 int skb_flow_dissector_bpf_prog_attach(const union bpf_attr *attr,
                                       struct bpf_prog *prog);

 int skb_flow_dissector_bpf_prog_detach(const union bpf_attr *attr);
+#else
+static inline int skb_flow_dissector_bpf_prog_attach(const union
bpf_attr *attr,
+                                                    struct bpf_prog *prog)
+{
+       return -EOPNOTSUPP;
+}
+
+static inline int skb_flow_dissector_bpf_prog_detach(const union
bpf_attr *attr)
+{
+       return -EOPNOTSUPP;
+}
+#endif

Re: linux-next: Tree for Sep 18 (kernel/bpf/syscall)

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2018-09-18 20:23:25

On Tue, Sep 18, 2018 at 12:28 PM Willem de Bruijn
[off-list ref] wrote:
On Tue, Sep 18, 2018 at 11:44 AM Daniel Borkmann [off-list ref] wrote:
quoted
[ Cc Petar and Willem ]

On 09/18/2018 05:37 PM, Randy Dunlap wrote:
quoted
On 9/17/18 10:12 PM, Stephen Rothwell wrote:
quoted
Hi all,

Changes since 20180913:
on i386 or x86_64: (in 6 of 20 randconfigs)

kernel/bpf/syscall.o: In function `__x64_sys_bpf':
syscall.c:(.text+0x3278): undefined reference to `skb_flow_dissector_bpf_prog_attach'
syscall.c:(.text+0x3310): undefined reference to `skb_flow_dissector_bpf_prog_detach'
kernel/bpf/syscall.o:(.rodata+0x3f0): undefined reference to `flow_dissector_prog_ops'
kernel/bpf/verifier.o:(.rodata+0x250): undefined reference to `flow_dissector_verifier_ops'

Full randconfig file is attached.
Looks like we need a wrapper for these, config had:

# CONFIG_NET is not set
Thanks for forwarding the report.

For the functions, I think we can use a similar static inline stub as
used e.g., for bpf_map_offload_map_alloc.

The _ops references are from a macro that includes linux/bpf_types.h,
so indeed a CONFIG looks needed.

I need to look it over before I send out, but tentative patch:
Sent http://patchwork.ozlabs.org/patch/971280/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help