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:23:40 +0000 (14:23 +0100)
commitb0028e1cc1faf2e5d88ad4065590aca90d650182
treea70191f8878fac02ee125762a8b34e1de6800988
parent732c7172b79ce0d39bc9c3aebbe38ba7dd14a265
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]