]> git.baikalelectronics.ru Git - kernel.git/commit
bpf/selftests: Test bpf_d_path on rdonly_mem.
authorHao Luo <haoluo@google.com>
Thu, 6 Jan 2022 20:55:25 +0000 (12:55 -0800)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 6 Jan 2022 23:20:49 +0000 (15:20 -0800)
commitc2e8609185b83d63e8c9b41543f08ca8af82a9f6
treee88c204993400047827074a50eb71bf3e50319bc
parent4e960a7657b45dc4df521ff15d52eb090d098239
bpf/selftests: Test bpf_d_path on rdonly_mem.

The second parameter of bpf_d_path() can only accept writable
memories. Rdonly_mem obtained from bpf_per_cpu_ptr() can not
be passed into bpf_d_path for modification. This patch adds
a selftest to verify this behavior.

Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220106205525.2116218-1-haoluo@google.com
tools/testing/selftests/bpf/prog_tests/d_path.c
tools/testing/selftests/bpf/progs/test_d_path_check_rdonly_mem.c [new file with mode: 0644]