]> www.infradead.org Git - users/dwmw2/linux.git/commit
selftests/bpf: Fix test_attach_probe
authorAlexei Starovoitov <ast@kernel.org>
Thu, 19 Dec 2019 02:04:42 +0000 (18:04 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:37:00 +0000 (04:37 -0800)
commitaaf1a502190e062cd8bf9c60f7d4a4fbfc22c2ec
treec6d34ebacb2c499a4b44f53cabd3556a529c6a6b
parentf0d2ce1c61b805d492c9152e8d4aa8f36d5a2660
selftests/bpf: Fix test_attach_probe

commit 580205dd4fe800b1e95be8b6df9e2991f975a8ad upstream.

Fix two issues in test_attach_probe:

1. it was not able to parse /proc/self/maps beyond the first line,
   since %s means parse string until white space.
2. offset has to be accounted for otherwise uprobed address is incorrect.

Fixes: 1e8611bbdfc9 ("selftests/bpf: add kprobe/uprobe selftests")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20191219020442.1922617-1-ast@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/prog_tests/attach_probe.c