]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: Show precise rejected function when attaching fexit/fmod_ret to __noreturn functions
authorKaFai Wan <kafai.wan@linux.dev>
Thu, 24 Jul 2025 15:14:51 +0000 (23:14 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 29 Jul 2025 02:39:29 +0000 (19:39 -0700)
commita5a6b29a700fda1dd766cc42dde2cbba9b19f470
treea3d348ee09aad837013a34fce666d617a4527dfe
parent5b4c54ac49af7f486806d79e3233fc8a9363961c
bpf: Show precise rejected function when attaching fexit/fmod_ret to __noreturn functions

With this change, we know the precise rejected function name when
attaching fexit/fmod_ret to __noreturn functions from log.

$ ./fexit
libbpf: prog 'fexit': BPF program load failed: -EINVAL
libbpf: prog 'fexit': -- BEGIN PROG LOAD LOG --
Attaching fexit/fmod_ret to __noreturn function 'do_exit' is rejected.

Suggested-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: KaFai Wan <kafai.wan@linux.dev>
Acked-by: Yafang Shao <laoar.shao@gmail.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20250724151454.499040-2-kafai.wan@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c
tools/testing/selftests/bpf/progs/fexit_noreturns.c