Re: [PATCHv3 bpf-next 06/24] bpf: Add multi tracing attach types
Hi Jiri, 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/Jiri-Olsa/ftrace-Add-ftrace_hash_count-function/20260316-160117 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master patch link: https://lore.kernel.org/r/20260316075138.465430-7-jolsa%40kernel.org patch subject: [PATCHv3 bpf-next 06/24] bpf: Add multi tracing attach types config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260320/[email protected]/config) compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260320/[email protected]/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 | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ All errors (new ones prefixed by >>): >> kernel/bpf/syscall.c:2967:15: error: call to undeclared function >> 'is_tracing_multi'; ISO C99 and later do not support implicit function >> declarations [-Wimplicit-function-declaration] 2967 | multi_func = is_tracing_multi(attr->expected_attach_type); | ^ 1 error generated. -- >> kernel/bpf/verifier.c:25059:9: error: call to undeclared function >> 'is_tracing_multi'; ISO C99 and later do not support implicit function >> declarations [-Wimplicit-function-declaration] 25059 | return is_tracing_multi(prog->expected_attach_type) && bpf_multi_func_btf_id[0] == btf_id; |^ kernel/bpf/verifier.c:25059:9: note: did you mean 'is_tracing_multi_id'? kernel/bpf/verifier.c:25057:13: note: 'is_tracing_multi_id' declared here 25057 | static bool is_tracing_multi_id(const struct bpf_prog *prog, u32 btf_id) | ^ 25058 | { 25059 | return is_tracing_multi(prog->expected_attach_type) && bpf_multi_func_btf_id[0] == btf_id; | |is_tracing_multi_id kernel/bpf/verifier.c:25566:6: error: call to undeclared function 'is_tracing_multi'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 25566 | is_tracing_multi(prog->expected_attach_type)) | ^ 2 errors generated. vim +/is_tracing_multi +2967 kernel/bpf/syscall.c 2890 2891 static int bpf_prog_load(union bpf_attr *attr, bpfptr_t uattr, u32 uattr_size) 2892 { 2893 enum bpf_prog_type type = attr->prog_type; 2894 struct bpf_prog *prog, *dst_prog = NULL; 2895 struct btf *attach_btf = NULL; 2896 struct bpf_token *token = NULL; 2897 bool bpf_cap; 2898 int err; 2899 char license[128]; 2900 bool multi_func; 2901 2902 if (CHECK_ATTR(BPF_PROG_LOAD)) 2903 return -EINVAL; 2904 2905 if (attr->prog_flags & ~(BPF_F_STRICT_ALIGNMENT | 2906 BPF_F_ANY_ALIGNMENT | 2907 BPF_F_TEST_STATE_FREQ | 2908 BPF_F_SLEEPABLE | 2909 BPF_F_TEST_RND_HI32 | 2910 BPF_F_XDP_HAS_FRAGS | 2911 BPF_F_XDP_DEV_BOUND_ONLY | 2912 BPF_F_TEST_REG_INVARIANTS | 2913 BPF_F_TOKEN_FD)) 2914 return -EINVAL; 2915 2916 bpf_prog_load_fixup_attach_type(attr); 2917 2918 if (attr->prog_flags & BPF_F_TOKEN_FD) { 2919 token = bpf_token_get_from_fd(attr->prog_token_fd); 2920 if (IS_ERR(token)) 2921 return PTR_ERR(token); 2922 /* if current token doesn't grant prog loading permissions, 2923 * then we can't use this token, so ignore it and rely on 2924 * system-wide capabilities checks 2925 */ 2926 if (!bpf_token_allow_cmd(token, BPF_PROG_LOAD) || 2927 !bpf_token_allow_prog_type(token, attr->prog_type, 2928 attr->expected_attach_type)) { 2929 bpf_token_put(token); 2930 token = NULL; 2931 } 2932 } 2933 2934 bpf_cap = bpf_token_capable(token, CAP_BPF); 2935 err = -EPERM; 2936 2937 if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && 2938 (attr->prog_flags & BPF_F_ANY_ALIGNMENT) && 2939
Re: [PATCHv3 bpf-next 06/24] bpf: Add multi tracing attach types
Hi Jiri, 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/Jiri-Olsa/ftrace-Add-ftrace_hash_count-function/20260316-160117 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master patch link: https://lore.kernel.org/r/20260316075138.465430-7-jolsa%40kernel.org patch subject: [PATCHv3 bpf-next 06/24] bpf: Add multi tracing attach types config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20260320/[email protected]/config) compiler: sh4-linux-gcc (GCC) 15.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260320/[email protected]/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 | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ All errors (new ones prefixed by >>): kernel/bpf/syscall.c: In function 'bpf_prog_load': >> kernel/bpf/syscall.c:2967:22: error: implicit declaration of function >> 'is_tracing_multi' [-Wimplicit-function-declaration] 2967 | multi_func = is_tracing_multi(attr->expected_attach_type); | ^~~~ -- kernel/bpf/verifier.c: In function 'is_tracing_multi_id': >> kernel/bpf/verifier.c:25059:16: error: implicit declaration of function >> 'is_tracing_multi'; did you mean 'is_tracing_multi_id'? >> [-Wimplicit-function-declaration] 25059 | return is_tracing_multi(prog->expected_attach_type) && bpf_multi_func_btf_id[0] == btf_id; |^~~~ |is_tracing_multi_id vim +/is_tracing_multi +2967 kernel/bpf/syscall.c 2890 2891 static int bpf_prog_load(union bpf_attr *attr, bpfptr_t uattr, u32 uattr_size) 2892 { 2893 enum bpf_prog_type type = attr->prog_type; 2894 struct bpf_prog *prog, *dst_prog = NULL; 2895 struct btf *attach_btf = NULL; 2896 struct bpf_token *token = NULL; 2897 bool bpf_cap; 2898 int err; 2899 char license[128]; 2900 bool multi_func; 2901 2902 if (CHECK_ATTR(BPF_PROG_LOAD)) 2903 return -EINVAL; 2904 2905 if (attr->prog_flags & ~(BPF_F_STRICT_ALIGNMENT | 2906 BPF_F_ANY_ALIGNMENT | 2907 BPF_F_TEST_STATE_FREQ | 2908 BPF_F_SLEEPABLE | 2909 BPF_F_TEST_RND_HI32 | 2910 BPF_F_XDP_HAS_FRAGS | 2911 BPF_F_XDP_DEV_BOUND_ONLY | 2912 BPF_F_TEST_REG_INVARIANTS | 2913 BPF_F_TOKEN_FD)) 2914 return -EINVAL; 2915 2916 bpf_prog_load_fixup_attach_type(attr); 2917 2918 if (attr->prog_flags & BPF_F_TOKEN_FD) { 2919 token = bpf_token_get_from_fd(attr->prog_token_fd); 2920 if (IS_ERR(token)) 2921 return PTR_ERR(token); 2922 /* if current token doesn't grant prog loading permissions, 2923 * then we can't use this token, so ignore it and rely on 2924 * system-wide capabilities checks 2925 */ 2926 if (!bpf_token_allow_cmd(token, BPF_PROG_LOAD) || 2927 !bpf_token_allow_prog_type(token, attr->prog_type, 2928 attr->expected_attach_type)) { 2929 bpf_token_put(token); 2930 token = NULL; 2931 } 2932 } 2933 2934 bpf_cap = bpf_token_capable(token, CAP_BPF); 2935 err = -EPERM; 2936 2937 if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && 2938 (attr->prog_flags & BPF_F_ANY_ALIGNMENT) && 2939 !bpf_cap) 2940 goto put_token; 2941 2942 /* Intent here is for unprivileged_bpf_disabled to block BPF program 2943 * creation for unprivileged users; other actions depend 2944 * on fd availability and access to bpffs, so are dependent on 2945 * object creation success. Even with unprivileged BPF disabled, 2946 * capability checks are still carried out for these 2947 * and other operations. 2948 */ 2949 if (sysctl_unprivileged_bpf_disabled && !bpf_cap) 2950 goto put_token; 2951 2952 if (attr->insn_cnt == 0 || 2953 attr->insn_cnt > (bpf_cap ? BPF_COMPLEXITY_LIMIT_INSNS : BPF_MAXINSNS)) { 2954
