From: kernel test robot <lkp@intel.com>
To: Florian Westphal <fw@strlen.de>, netdev@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, netfilter-devel@vger.kernel.org,
bpf@vger.kernel.org, dxu@dxuuu.xyz, qde@naccy.de,
Florian Westphal <fw@strlen.de>
Subject: Re: [PATCH bpf-next 1/6] bpf: add bpf_link support for BPF_NETFILTER programs
Date: Thu, 6 Apr 2023 12:50:53 +0800 [thread overview]
Message-ID: <202304061228.XRcVvxoL-lkp@intel.com> (raw)
In-Reply-To: <20230405161116.13565-2-fw@strlen.de>
Hi Florian,
kernel test robot noticed the following build errors:
[auto build test ERROR on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Florian-Westphal/bpf-add-bpf_link-support-for-BPF_NETFILTER-programs/20230406-001447
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20230405161116.13565-2-fw%40strlen.de
patch subject: [PATCH bpf-next 1/6] bpf: add bpf_link support for BPF_NETFILTER programs
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20230406/202304061228.XRcVvxoL-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/f373efb623e6ff708403b172fafb506028de6cb8
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Florian-Westphal/bpf-add-bpf_link-support-for-BPF_NETFILTER-programs/20230406-001447
git checkout f373efb623e6ff708403b172fafb506028de6cb8
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304061228.XRcVvxoL-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: vmlinux.o: in function `link_create':
>> kernel/bpf/syscall.c:4671: undefined reference to `bpf_nf_link_attach'
vim +4671 kernel/bpf/syscall.c
4578
4579 #define BPF_LINK_CREATE_LAST_FIELD link_create.kprobe_multi.cookies
4580 static int link_create(union bpf_attr *attr, bpfptr_t uattr)
4581 {
4582 enum bpf_prog_type ptype;
4583 struct bpf_prog *prog;
4584 int ret;
4585
4586 if (CHECK_ATTR(BPF_LINK_CREATE))
4587 return -EINVAL;
4588
4589 if (attr->link_create.attach_type == BPF_STRUCT_OPS)
4590 return bpf_struct_ops_link_create(attr);
4591
4592 prog = bpf_prog_get(attr->link_create.prog_fd);
4593 if (IS_ERR(prog))
4594 return PTR_ERR(prog);
4595
4596 ret = bpf_prog_attach_check_attach_type(prog,
4597 attr->link_create.attach_type);
4598 if (ret)
4599 goto out;
4600
4601 switch (prog->type) {
4602 case BPF_PROG_TYPE_EXT:
4603 case BPF_PROG_TYPE_NETFILTER:
4604 break;
4605 case BPF_PROG_TYPE_PERF_EVENT:
4606 case BPF_PROG_TYPE_TRACEPOINT:
4607 if (attr->link_create.attach_type != BPF_PERF_EVENT) {
4608 ret = -EINVAL;
4609 goto out;
4610 }
4611 break;
4612 case BPF_PROG_TYPE_KPROBE:
4613 if (attr->link_create.attach_type != BPF_PERF_EVENT &&
4614 attr->link_create.attach_type != BPF_TRACE_KPROBE_MULTI) {
4615 ret = -EINVAL;
4616 goto out;
4617 }
4618 break;
4619 default:
4620 ptype = attach_type_to_prog_type(attr->link_create.attach_type);
4621 if (ptype == BPF_PROG_TYPE_UNSPEC || ptype != prog->type) {
4622 ret = -EINVAL;
4623 goto out;
4624 }
4625 break;
4626 }
4627
4628 switch (prog->type) {
4629 case BPF_PROG_TYPE_CGROUP_SKB:
4630 case BPF_PROG_TYPE_CGROUP_SOCK:
4631 case BPF_PROG_TYPE_CGROUP_SOCK_ADDR:
4632 case BPF_PROG_TYPE_SOCK_OPS:
4633 case BPF_PROG_TYPE_CGROUP_DEVICE:
4634 case BPF_PROG_TYPE_CGROUP_SYSCTL:
4635 case BPF_PROG_TYPE_CGROUP_SOCKOPT:
4636 ret = cgroup_bpf_link_attach(attr, prog);
4637 break;
4638 case BPF_PROG_TYPE_EXT:
4639 ret = bpf_tracing_prog_attach(prog,
4640 attr->link_create.target_fd,
4641 attr->link_create.target_btf_id,
4642 attr->link_create.tracing.cookie);
4643 break;
4644 case BPF_PROG_TYPE_LSM:
4645 case BPF_PROG_TYPE_TRACING:
4646 if (attr->link_create.attach_type != prog->expected_attach_type) {
4647 ret = -EINVAL;
4648 goto out;
4649 }
4650 if (prog->expected_attach_type == BPF_TRACE_RAW_TP)
4651 ret = bpf_raw_tp_link_attach(prog, NULL);
4652 else if (prog->expected_attach_type == BPF_TRACE_ITER)
4653 ret = bpf_iter_link_attach(attr, uattr, prog);
4654 else if (prog->expected_attach_type == BPF_LSM_CGROUP)
4655 ret = cgroup_bpf_link_attach(attr, prog);
4656 else
4657 ret = bpf_tracing_prog_attach(prog,
4658 attr->link_create.target_fd,
4659 attr->link_create.target_btf_id,
4660 attr->link_create.tracing.cookie);
4661 break;
4662 case BPF_PROG_TYPE_FLOW_DISSECTOR:
4663 case BPF_PROG_TYPE_SK_LOOKUP:
4664 ret = netns_bpf_link_create(attr, prog);
4665 break;
4666 #ifdef CONFIG_NET
4667 case BPF_PROG_TYPE_XDP:
4668 ret = bpf_xdp_link_attach(attr, prog);
4669 break;
4670 case BPF_PROG_TYPE_NETFILTER:
> 4671 ret = bpf_nf_link_attach(attr, prog);
4672 break;
4673 #endif
4674 case BPF_PROG_TYPE_PERF_EVENT:
4675 case BPF_PROG_TYPE_TRACEPOINT:
4676 ret = bpf_perf_link_attach(attr, prog);
4677 break;
4678 case BPF_PROG_TYPE_KPROBE:
4679 if (attr->link_create.attach_type == BPF_PERF_EVENT)
4680 ret = bpf_perf_link_attach(attr, prog);
4681 else
4682 ret = bpf_kprobe_multi_link_attach(attr, prog);
4683 break;
4684 default:
4685 ret = -EINVAL;
4686 }
4687
4688 out:
4689 if (ret < 0)
4690 bpf_prog_put(prog);
4691 return ret;
4692 }
4693
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-04-06 4:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-05 16:11 [PATCH bpf-next 0/6] bpf: add netfilter program type Florian Westphal
2023-04-05 16:11 ` [PATCH bpf-next 1/6] bpf: add bpf_link support for BPF_NETFILTER programs Florian Westphal
2023-04-06 4:50 ` kernel test robot [this message]
2023-04-05 16:11 ` [PATCH bpf-next 2/6] bpf: minimal support for programs hooked into netfilter framework Florian Westphal
2023-04-05 16:11 ` [PATCH bpf-next 3/6] netfilter: nfnetlink hook: dump bpf prog id Florian Westphal
2023-04-05 16:11 ` [PATCH bpf-next 4/6] netfilter: disallow bpf hook attachment at same priority Florian Westphal
2023-04-05 16:11 ` [PATCH bpf-next 5/6] tools: bpftool: print netfilter link info Florian Westphal
2023-04-05 16:11 ` [PATCH bpf-next 6/6] bpf: add test_run support for netfilter program type Florian Westphal
2023-04-05 18:22 ` kernel test robot
2023-04-07 1:36 ` Alexei Starovoitov
2023-04-08 21:38 ` Florian Westphal
2023-04-12 8:20 ` [PATCH bpf-next 0/6] bpf: add " Quentin Deslandes
2023-04-12 9:45 ` Florian Westphal
2023-04-13 9:26 ` Quentin Deslandes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202304061228.XRcVvxoL-lkp@intel.com \
--to=lkp@intel.com \
--cc=bpf@vger.kernel.org \
--cc=dxu@dxuuu.xyz \
--cc=fw@strlen.de \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=qde@naccy.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.