aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorAlban Crequy <[email protected]>2022-11-10 09:56:14 +0100
committerAndrii Nakryiko <[email protected]>2022-11-11 11:44:46 -0800
commit9cd094829dae949a755c18533479c20e74415ab2 (patch)
tree09a8c1c050975d07822ecdf5fb8197be912d20c0 /tools/perf/scripts/python/stackcollapse.py
parent8678ea06852cd1f819b870c773d43df888d15d46 (diff)
selftests: bpf: Add a test when bpf_probe_read_kernel_str() returns EFAULT
This commit tests previous fix of bpf_probe_read_kernel_str(). The BPF helper bpf_probe_read_kernel_str should return -EFAULT when given a bad source pointer and the target buffer should only be modified to make the string NULL terminated. bpf_probe_read_kernel_str() was previously inserting a NULL before the beginning of the dst buffer. This test should ensure that the implementation stays correct for now on. Without the fix, this test will fail as follows: $ cd tools/testing/selftests/bpf $ make $ sudo ./test_progs --name=varlen ... test_varlen:FAIL:check got 0 != exp 66 Signed-off-by: Alban Crequy <[email protected]> Signed-off-by: Francis Laniel <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Changes v1 to v2: - add ack tag - fix my email - rebase on bpf tree and tag for bpf tree
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions