aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_global_func17.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-04-06selftests/bpf: Test passing rdonly mem to global funcKumar Kartikeya Dwivedi1-0/+16
Add two test cases, one pass read only map value pointer to global func, which should be rejected. The same code checks it for kfunc, so that is covered as well. Second one tries to use the missing check for PTR_TO_MEM's MEM_RDONLY flag and tries to write to a read only memory pointer. Without prior patches, both of these tests fail. Reviewed-by: Hao Luo <haoluo@google.com> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20220319080827.73251-5-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>