summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/for_each_map_elem_write_key.c
AgeCommit message (Collapse)AuthorFilesLines
2022-04-06selftests/bpf: Test for writes to map key from BPF helpersKumar Kartikeya Dwivedi1-0/+27
When invoking bpf_for_each_map_elem callback, we are passed a PTR_TO_MAP_KEY, previously writes to this through helper may be allowed, but the fix in previous patches is meant to prevent that case. The test case tries to pass it as writable memory to helper, and fails test if it succeeds to pass the verifier. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20220319080827.73251-6-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>