All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Florian Westphal <fw@strlen.de>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH RFC v2 bpf-next 1/3] bpf: add bpf_link support for BPF_NETFILTER programs
Date: Fri, 3 Mar 2023 04:07:40 +0800	[thread overview]
Message-ID: <202303030452.W2gRyUnd-lkp@intel.com> (raw)
In-Reply-To: <20230302172757.9548-2-fw@strlen.de>

Hi Florian,

[FYI, it's a private test report for your RFC patch.]
[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/20230303-013022
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20230302172757.9548-2-fw%40strlen.de
patch subject: [PATCH RFC v2 bpf-next 1/3] bpf: add bpf_link support for BPF_NETFILTER programs
config: i386-randconfig-a003 (https://download.01.org/0day-ci/archive/20230303/202303030452.W2gRyUnd-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/dafd9c7dce974be4bf60f89c8427a765acfcba77
        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/20230303-013022
        git checkout dafd9c7dce974be4bf60f89c8427a765acfcba77
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 olddefconfig
        make W=1 O=build_dir ARCH=i386 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/202303030452.W2gRyUnd-lkp@intel.com/

All errors (new ones prefixed by >>):

   ld: kernel/bpf/syscall.o: in function `link_create':
>> kernel/bpf/syscall.c:4641: undefined reference to `bpf_nf_link_attach'


vim +4641 kernel/bpf/syscall.c

  4551	
  4552	#define BPF_LINK_CREATE_LAST_FIELD link_create.kprobe_multi.cookies
  4553	static int link_create(union bpf_attr *attr, bpfptr_t uattr)
  4554	{
  4555		enum bpf_prog_type ptype;
  4556		struct bpf_prog *prog;
  4557		int ret;
  4558	
  4559		if (CHECK_ATTR(BPF_LINK_CREATE))
  4560			return -EINVAL;
  4561	
  4562		prog = bpf_prog_get(attr->link_create.prog_fd);
  4563		if (IS_ERR(prog))
  4564			return PTR_ERR(prog);
  4565	
  4566		ret = bpf_prog_attach_check_attach_type(prog,
  4567							attr->link_create.attach_type);
  4568		if (ret)
  4569			goto out;
  4570	
  4571		switch (prog->type) {
  4572		case BPF_PROG_TYPE_EXT:
  4573		case BPF_PROG_TYPE_NETFILTER:
  4574			break;
  4575		case BPF_PROG_TYPE_PERF_EVENT:
  4576		case BPF_PROG_TYPE_TRACEPOINT:
  4577			if (attr->link_create.attach_type != BPF_PERF_EVENT) {
  4578				ret = -EINVAL;
  4579				goto out;
  4580			}
  4581			break;
  4582		case BPF_PROG_TYPE_KPROBE:
  4583			if (attr->link_create.attach_type != BPF_PERF_EVENT &&
  4584			    attr->link_create.attach_type != BPF_TRACE_KPROBE_MULTI) {
  4585				ret = -EINVAL;
  4586				goto out;
  4587			}
  4588			break;
  4589		default:
  4590			ptype = attach_type_to_prog_type(attr->link_create.attach_type);
  4591			if (ptype == BPF_PROG_TYPE_UNSPEC || ptype != prog->type) {
  4592				ret = -EINVAL;
  4593				goto out;
  4594			}
  4595			break;
  4596		}
  4597	
  4598		switch (prog->type) {
  4599		case BPF_PROG_TYPE_CGROUP_SKB:
  4600		case BPF_PROG_TYPE_CGROUP_SOCK:
  4601		case BPF_PROG_TYPE_CGROUP_SOCK_ADDR:
  4602		case BPF_PROG_TYPE_SOCK_OPS:
  4603		case BPF_PROG_TYPE_CGROUP_DEVICE:
  4604		case BPF_PROG_TYPE_CGROUP_SYSCTL:
  4605		case BPF_PROG_TYPE_CGROUP_SOCKOPT:
  4606			ret = cgroup_bpf_link_attach(attr, prog);
  4607			break;
  4608		case BPF_PROG_TYPE_EXT:
  4609			ret = bpf_tracing_prog_attach(prog,
  4610						      attr->link_create.target_fd,
  4611						      attr->link_create.target_btf_id,
  4612						      attr->link_create.tracing.cookie);
  4613			break;
  4614		case BPF_PROG_TYPE_LSM:
  4615		case BPF_PROG_TYPE_TRACING:
  4616			if (attr->link_create.attach_type != prog->expected_attach_type) {
  4617				ret = -EINVAL;
  4618				goto out;
  4619			}
  4620			if (prog->expected_attach_type == BPF_TRACE_RAW_TP)
  4621				ret = bpf_raw_tp_link_attach(prog, NULL);
  4622			else if (prog->expected_attach_type == BPF_TRACE_ITER)
  4623				ret = bpf_iter_link_attach(attr, uattr, prog);
  4624			else if (prog->expected_attach_type == BPF_LSM_CGROUP)
  4625				ret = cgroup_bpf_link_attach(attr, prog);
  4626			else
  4627				ret = bpf_tracing_prog_attach(prog,
  4628							      attr->link_create.target_fd,
  4629							      attr->link_create.target_btf_id,
  4630							      attr->link_create.tracing.cookie);
  4631			break;
  4632		case BPF_PROG_TYPE_FLOW_DISSECTOR:
  4633		case BPF_PROG_TYPE_SK_LOOKUP:
  4634			ret = netns_bpf_link_create(attr, prog);
  4635			break;
  4636	#ifdef CONFIG_NET
  4637		case BPF_PROG_TYPE_XDP:
  4638			ret = bpf_xdp_link_attach(attr, prog);
  4639			break;
  4640		case BPF_PROG_TYPE_NETFILTER:
> 4641			ret = bpf_nf_link_attach(attr, prog);
  4642			break;
  4643	#endif
  4644		case BPF_PROG_TYPE_PERF_EVENT:
  4645		case BPF_PROG_TYPE_TRACEPOINT:
  4646			ret = bpf_perf_link_attach(attr, prog);
  4647			break;
  4648		case BPF_PROG_TYPE_KPROBE:
  4649			if (attr->link_create.attach_type == BPF_PERF_EVENT)
  4650				ret = bpf_perf_link_attach(attr, prog);
  4651			else
  4652				ret = bpf_kprobe_multi_link_attach(attr, prog);
  4653			break;
  4654		default:
  4655			ret = -EINVAL;
  4656		}
  4657	
  4658	out:
  4659		if (ret < 0)
  4660			bpf_prog_put(prog);
  4661		return ret;
  4662	}
  4663	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

  reply	other threads:[~2023-03-02 20:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 17:27 [PATCH RFC v2 bpf-next 0/3] bpf: add netfilter program type Florian Westphal
2023-03-02 17:27 ` [PATCH RFC v2 bpf-next 1/3] bpf: add bpf_link support for BPF_NETFILTER programs Florian Westphal
2023-03-02 20:07   ` kernel test robot [this message]
2023-03-02 20:28   ` Stanislav Fomichev
2023-03-03  0:27     ` Florian Westphal
2023-03-23  0:41       ` Daniel Xu
2023-03-23 18:31         ` Stanislav Fomichev
2023-03-24 17:33           ` Daniel Xu
2023-03-24 17:58             ` Stanislav Fomichev
2023-03-24 18:22               ` Florian Westphal
2023-03-24 19:22                 ` Stanislav Fomichev
2023-03-02 21:10   ` kernel test robot
2023-03-02 17:27 ` [PATCH RFC v2 bpf-next 2/3] libbpf: sync header file, add nf prog section name Florian Westphal
2023-03-02 17:27 ` [PATCH RFC v2 bpf-next 3/3] bpf: minimal support for programs hooked into netfilter framework Florian Westphal
2023-03-02 19:59   ` Toke Høiland-Jørgensen
2023-03-02 23:53     ` Florian Westphal
2023-03-03  0:06       ` Toke Høiland-Jørgensen
2023-03-02 19:59 ` [PATCH RFC v2 bpf-next 0/3] bpf: add netfilter program type Toke Høiland-Jørgensen
2023-03-23  0:36 ` Daniel Xu
2023-03-24 18:36   ` Florian Westphal

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=202303030452.W2gRyUnd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=fw@strlen.de \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.