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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Mar 2022 13:15:59 +0000 (14:15 +0100)
commit4fb9be675be8360bede6fb8f0cad7948393fbef8
treedcb26c125c8e119d907f0374833eb58945479870
parentdc1c2b47b539b17fd7144513d6e23f00477dcb11
selftests/bpf: Add test for bpf_timer overwriting crash

[ Upstream commit a7e75016a0753c24d6c995bc02501ae35368e333 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
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]