diff options
| author | Alan Maguire <[email protected]> | 2021-11-05 16:50:46 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2021-11-08 21:17:55 +0000 |
| commit | c23551c9c36ae394f9c53a5adf1944a943c65e0b (patch) | |
| tree | 471a3ccfe813414650448557d08ac6380db24eca /tools/bpf/bpftool/prog.c | |
| parent | arm64/bpf: Remove 128MB limit for BPF JIT programs (diff) | |
| download | kernel-c23551c9c36ae394f9c53a5adf1944a943c65e0b.tar.gz kernel-c23551c9c36ae394f9c53a5adf1944a943c65e0b.zip | |
selftests/bpf: Add exception handling selftests for tp_bpf program
Exception handling is triggered in BPF tracing programs when a NULL pointer
is dereferenced; the exception handler zeroes the target register and
execution of the BPF program progresses.
To test exception handling then, we need to trigger a NULL pointer dereference
for a field which should never be zero; if it is, the only explanation is the
exception handler ran. task->task_works is the NULL pointer chosen (for a new
task from fork() no work is associated), and the task_works->func field should
not be zero if task_works is non-NULL. The test verifies that task_works and
task_works->func are 0.
Signed-off-by: Alan Maguire <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions
