selftests/bpf: Add test for bpf_timer overwriting crash
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Wed, 9 Feb 2022 07:03:24 +0000 (12:33 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 11 Feb 2022 21:13:04 +0000 (13:13 -0800)
commita7e75016a0753c24d6c995bc02501ae35368e333
tree54d657bc7593fa1eae529ceec59827dd754b5d32
parenta8abb0c3dc1e28454851a00f8b7333d9695d566c
selftests/bpf: Add test for bpf_timer overwriting crash

Add a test that validates that timer value is not overwritten when doing
a copy_map_value call in the kernel. Without the prior fix, this test
triggers a crash.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220209070324.1093182-3-memxor@gmail.com
tools/testing/selftests/bpf/prog_tests/timer_crash.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/timer_crash.c [new file with mode: 0644]