Attaching fexit probes to functions marked with __noreturn may lead to unpredictable behavior. To avoid this, we will reject attaching probes to such functions. Currently, there is no ideal solution, so we will hardcode a check for all __noreturn functions. Since objtool already handles this, we will leverage its implementation. Once a more robust solution is found, this workaround can be removed. Yafang Shao (3): objtool: Move noreturns.h to a common location bpf: Reject attaching fexit to functions annotated with __noreturn selftests/bpf: Add selftest for attaching fexit to __noreturn functions {tools/objtool => include/linux}/noreturns.h | 0 kernel/bpf/verifier.c | 10 ++++ tools/include/linux/noreturns.h | 52 +++++++++++++++++++ tools/objtool/Documentation/objtool.txt | 3 +- tools/objtool/check.c | 2 +- .../bpf/prog_tests/fexit_noreturns.c | 13 +++++ .../selftests/bpf/progs/fexit_noreturns.c | 13 +++++ 7 files changed, 91 insertions(+), 2 deletions(-) rename {tools/objtool => include/linux}/noreturns.h (100%) create mode 100644 tools/include/linux/noreturns.h create mode 100644 tools/testing/selftests/bpf/prog_tests/fexit_noreturns.c create mode 100644 tools/testing/selftests/bpf/progs/fexit_noreturns.c -- 2.43.5