On Tue, Feb 25, 2025 at 1:30 AM Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > On Mon, Feb 24, 2025 at 3:46 AM Yafang Shao <laoar.shao@xxxxxxxxx> wrote: > > > > + } else if (prog->expected_attach_type == BPF_TRACE_FEXIT && > > + btf_id_set_contains(&fexit_deny, btf_id)) { > > + verbose(env, "Attaching fexit to __noreturn functions is rejected.\n"); > > + return -EINVAL; > > Just realized that this needs to include > prog->expected_attach_type == BPF_MODIFY_RETURN > since it's doing __bpf_tramp_enter() too. I will add it. > > Also the list must only contain existing functions. > Otherwise there are plenty of build warns: > BTFIDS vmlinux > WARN: resolve_btfids: unresolved symbol xen_start_kernel > WARN: resolve_btfids: unresolved symbol xen_cpu_bringup_again > WARN: resolve_btfids: unresolved symbol usercopy_abort > WARN: resolve_btfids: unresolved symbol snp_abort > WARN: resolve_btfids: unresolved symbol sev_es_terminate > WARN: resolve_btfids: unresolved symbol rust_helper_BUG > ... I missed these warnings. It looks like we need to add "#ifdef XXXX" to each function. Alternatively, could we just compare the function name with prog->aux->attach_func_name instead? -- Regards Yafang