Re: [PATCH v3 1/2] bpf: Reject attaching fexit to functions annotated with __noreturn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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
...

pw-bot: cr





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux