OSDN Git Service

selftests/bpf: Validate arch-specific argument registers limits
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 20 Jan 2023 20:09:00 +0000 (12:09 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 23 Jan 2023 19:53:00 +0000 (20:53 +0100)
commitbc72742bebec8e0766af1e07e13169a873f9119c
tree027818ac31cd6e04710828bbcafb29c8259e9c39
parentac4afd6e6fa4d4f9a0ab6ca76f4953545e4da7e6
selftests/bpf: Validate arch-specific argument registers limits

Update uprobe_autoattach selftest to validate architecture-specific
argument passing through registers. Use new BPF_UPROBE and
BPF_URETPROBE, and construct both BPF-side and user-space side in such
a way that for different architectures we are fetching and checking
different number of arguments, matching architecture-specific limit of
how many registers are available for argument passing.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Alan Maguire <alan.maguire@oracle.com> # arm64
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com> # s390x
Link: https://lore.kernel.org/bpf/20230120200914.3008030-12-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/uprobe_autoattach.c
tools/testing/selftests/bpf/progs/bpf_misc.h
tools/testing/selftests/bpf/progs/test_uprobe_autoattach.c