Re: [PATCH v2 2/5] seccomp, bpf: Introduce SECCOMP_LOAD_FILTER operation

From: kernel test robot
Date: Sun Oct 22 2023 - 19:43:34 EST


Hi Hengqi,

kernel test robot noticed the following build errors:

[auto build test ERROR on kees/for-next/seccomp]
[also build test ERROR on bpf-next/master bpf/master linus/master v6.6-rc6 next-20231020]
[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/Hengqi-Chen/seccomp-Refactor-filter-copy-create-for-reuse/20231017-134654
base: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/seccomp
patch link: https://lore.kernel.org/r/20231015232953.84836-3-hengqi.chen%40gmail.com
patch subject: [PATCH v2 2/5] seccomp, bpf: Introduce SECCOMP_LOAD_FILTER operation
config: sh-shx3_defconfig (https://download.01.org/0day-ci/archive/20231023/202310230704.Uif0R7cz-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231023/202310230704.Uif0R7cz-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310230704.Uif0R7cz-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

kernel/seccomp.c: In function 'seccomp_load_filter':
>> kernel/seccomp.c:2052:15: error: implicit declaration of function 'security_bpf_prog_alloc'; did you mean 'security_msg_msg_alloc'? [-Werror=implicit-function-declaration]
2052 | ret = security_bpf_prog_alloc(prog->aux);
| ^~~~~~~~~~~~~~~~~~~~~~~
| security_msg_msg_alloc
>> kernel/seccomp.c:2062:15: error: implicit declaration of function 'bpf_prog_new_fd'; did you mean 'bpf_prog_get_ok'? [-Werror=implicit-function-declaration]
2062 | ret = bpf_prog_new_fd(prog);
| ^~~~~~~~~~~~~~~
| bpf_prog_get_ok
cc1: some warnings being treated as errors


vim +2052 kernel/seccomp.c

2037
2038 static long seccomp_load_filter(const char __user *filter)
2039 {
2040 struct sock_fprog fprog;
2041 struct bpf_prog *prog;
2042 int ret;
2043
2044 ret = seccomp_copy_user_filter(filter, &fprog);
2045 if (ret)
2046 return ret;
2047
2048 ret = seccomp_prepare_prog(&prog, &fprog);
2049 if (ret)
2050 return ret;
2051
> 2052 ret = security_bpf_prog_alloc(prog->aux);
2053 if (ret) {
2054 bpf_prog_free(prog);
2055 return ret;
2056 }
2057
2058 prog->aux->user = get_current_user();
2059 atomic64_set(&prog->aux->refcnt, 1);
2060 prog->type = BPF_PROG_TYPE_SECCOMP;
2061
> 2062 ret = bpf_prog_new_fd(prog);
2063 if (ret < 0)
2064 bpf_prog_put(prog);
2065
2066 return ret;
2067 }
2068 #else
2069 static inline long seccomp_set_mode_filter(unsigned int flags,
2070 const char __user *filter)
2071 {
2072 return -EINVAL;
2073 }
2074

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