[PATCH bpf-next 0/3] bpf: Reject attaching fexit to __noreturn functions

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

 



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





[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