Re: [PATCH v2] bpf: restore the ebpf program ID for BPF_AUDIT_UNLOAD and PERF_BPF_EVENT_PROG_UNLOAD

kernel test robot <[email protected]>
Newsgroups com.redhat.linux-audit,dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
Hi Paul,

I love your patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]
[also build test ERROR on bpf/master tip/perf/core acme/perf/core linus/master v6.1 next-20221220]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Moore/bpf-restore-the-ebpf-program-ID-for-BPF_AUDIT_UNLOAD-and-PERF_BPF_EVENT_PROG_UNLOAD/20221224-025703
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20221223185531.222689-1-paul%40paul-moore.com
patch subject: [PATCH v2] bpf: restore the ebpf program ID for BPF_AUDIT_UNLOAD and PERF_BPF_EVENT_PROG_UNLOAD
config: x86_64-defconfig
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/30e779c8882f2f84869405eef26e37785a1849ac
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Paul-Moore/bpf-restore-the-ebpf-program-ID-for-BPF_AUDIT_UNLOAD-and-PERF_BPF_EVENT_PROG_UNLOAD/20221224-025703
        git checkout 30e779c8882f2f84869405eef26e37785a1849ac
        # 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 <[email protected]>

All errors (new ones prefixed by >>):

   In file included from kernel/bpf/core.c:35:
   include/linux/bpf_verifier.h: In function 'bpf_trampoline_compute_key':
>> include/linux/bpf_verifier.h:627:30: error: implicit declaration of function 'bpf_prog_get_id'; did you mean 'bpf_prog_get_ok'? [-Werror=implicit-function-declaration]
     627 |                 return ((u64)bpf_prog_get_id(tgt_prog) << 32) | btf_id;
         |                              ^~~~~~~~~~~~~~~
         |                              bpf_prog_get_ok
   kernel/bpf/core.c: At top level:
   kernel/bpf/core.c:1632:12: warning: no previous prototype for 'bpf_probe_read_kernel' [-Wmissing-prototypes]
    1632 | u64 __weak bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr)
         |            ^~~~~~~~~~~~~~~~~~~~~
   kernel/bpf/core.c:2071:6: warning: no previous prototype for 'bpf_patch_call_args' [-Wmissing-prototypes]
    2071 | void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth)
         |      ^~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   net/core/dev.c: In function 'dev_xdp_prog_id':
>> net/core/dev.c:9063:23: error: implicit declaration of function 'bpf_prog_get_id'; did you mean 'bpf_prog_get_ok'? [-Werror=implicit-function-declaration]
    9063 |         return prog ? bpf_prog_get_id(prog) : 0;
         |                       ^~~~~~~~~~~~~~~
         |                       bpf_prog_get_ok
   cc1: some warnings being treated as errors
--
   net/core/rtnetlink.c: In function 'rtnl_xdp_prog_skb':
>> net/core/rtnetlink.c:1468:16: error: implicit declaration of function 'bpf_prog_get_id'; did you mean 'bpf_prog_get_ok'? [-Werror=implicit-function-declaration]
    1468 |         return bpf_prog_get_id(generic_xdp_prog);
         |                ^~~~~~~~~~~~~~~
         |                bpf_prog_get_ok
   cc1: some warnings being treated as errors
--
   In file included from net/core/filter.c:21:
   include/linux/bpf_verifier.h: In function 'bpf_trampoline_compute_key':
>> include/linux/bpf_verifier.h:627:30: error: implicit declaration of function 'bpf_prog_get_id'; did you mean 'bpf_prog_get_ok'? [-Werror=implicit-function-declaration]
     627 |                 return ((u64)bpf_prog_get_id(tgt_prog) << 32) | btf_id;
         |                              ^~~~~~~~~~~~~~~
         |                              bpf_prog_get_ok
   cc1: some warnings being treated as errors


vim +627 include/linux/bpf_verifier.h

   610	
   611	int check_ptr_off_reg(struct bpf_verifier_env *env,
   612			      const struct bpf_reg_state *reg, int regno);
   613	int check_func_arg_reg_off(struct bpf_verifier_env *env,
   614				   const struct bpf_reg_state *reg, int regno,
   615				   enum bpf_arg_type arg_type);
   616	int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg,
   617			   u32 regno, u32 mem_size);
   618	struct bpf_call_arg_meta;
   619	int process_dynptr_func(struct bpf_verifier_env *env, int regno,
   620				enum bpf_arg_type arg_type, struct bpf_call_arg_meta *meta);
   621	
   622	/* this lives here instead of in bpf.h because it needs to dereference tgt_prog */
   623	static inline u64 bpf_trampoline_compute_key(const struct bpf_prog *tgt_prog,
   624						     struct btf *btf, u32 btf_id)
   625	{
   626		if (tgt_prog)
 > 627			return ((u64)bpf_prog_get_id(tgt_prog) << 32) | btf_id;
   628		else
   629			return ((u64)btf_obj_id(btf) << 32) | 0x80000000 | btf_id;
   630	}
   631	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

--
Linux-audit mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-audit
config (text/plain, 135.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.