Skip to contentSkip to conversation

microblaze-linux-ld: kernel/bpf/syscall.o:undefined reference to `netfilter_prog_ops'

PATCH Applied kernel test robot 4 participants 4 messages Apr 22, 2023

Subsystems (2)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
head:   4db10a8243df665ced10b027c2d4862173a7a3ec
commit: fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d [4/32] bpf: minimal support for programs hooked into netfilter framework
config: microblaze-randconfig-r013-20230421 (https://download.01.org/0day-ci/archive/20230422/[email protected]/config)
compiler: microblaze-linux-gcc (GCC) 12.1.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d
git remote add bpf-next https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
git fetch --no-tags bpf-next master
git checkout fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=microblaze olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=microblaze SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> microblaze-linux-ld: kernel/bpf/syscall.o:(.rodata+0xc6c): undefined reference to `netfilter_prog_ops'
>> microblaze-linux-ld: kernel/bpf/verifier.o:(.rodata+0x6dcc): undefined reference to `netfilter_verifier_ops'
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
#1 lore raw

PATCH 1/1 bpf: fix link failure with NETFILTER=y INET=n

Explicitly check if NETFILTER_BPF_LINK is enabled, else configs that have NETFILTER=y but CONFIG_INET=n fail to link:

Quoted 2 lines

kernel/bpf/syscall.o: undefined reference to netfilter_prog_ops' kernel/bpf/verifier.o: undefined reference to netfilter_verifier_ops'

Fixes fd9c663b9ad6 ("bpf: minimal support for programs hooked into netfilter framework")

---
checked that my 'goodconfig' still yields a kernel that accepts bpf-nf progs.

 include/linux/bpf_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/bpf_types.h +1 -1
index 39a999abb0ce..fc0d6f32c687 100644
@@ -79,7 +79,7 @@ BPF_PROG_TYPE(BPF_PROG_TYPE_LSM, lsm,
 #endif
 BPF_PROG_TYPE(BPF_PROG_TYPE_SYSCALL, bpf_syscall,
 	      void *, void *)
-#ifdef CONFIG_NETFILTER
+#ifdef CONFIG_NETFILTER_BPF_LINK
 BPF_PROG_TYPE(BPF_PROG_TYPE_NETFILTER, netfilter,
 	      struct bpf_nf_ctx, struct bpf_nf_ctx)
 #endif
Signature · 1 line
2.39.2
#2 lore raw

Re: [PATCH bpf-next] bpf: fix link failure with NETFILTER=y INET=n

Quoted 3 lines · Florian Westphal

Explicitly check if NETFILTER_BPF_LINK is enabled, else configs that have NETFILTER=y but CONFIG_INET=n fail to link:

netfilter=y and inet=n ? wow. Didn't realize such a config is possible. Thanks for the quick fix.
Applied.

Quoted 2 lines
Quoted 2 lines

kernel/bpf/syscall.o: undefined reference to netfilter_prog_ops' kernel/bpf/verifier.o: undefined reference to netfilter_verifier_ops'

#3 lore raw

Re: [PATCH bpf-next] bpf: fix link failure with NETFILTER=y INET=n

In reply to Florian Westphal
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 6 lines · On Sat, 22 Apr 2023 09:35:44 +0200 you wrote:

Explicitly check if NETFILTER_BPF_LINK is enabled, else configs that have NETFILTER=y but CONFIG_INET=n fail to link:

Quoted 2 lines

kernel/bpf/syscall.o: undefined reference to netfilter_prog_ops' kernel/bpf/verifier.o: undefined reference to netfilter_verifier_ops'

Quoted 6 lines
Fixes fd9c663b9ad6 ("bpf: minimal support for programs hooked into netfilter framework")

[...]

Here is the summary with links:
- [bpf-next] bpf: fix link failure with NETFILTER=y INET=n

    https://git.kernel.org/bpf/bpf-next/c/6d26d985eeda

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html