]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add verifier test for PTR_TO_MEM spill
authorGilad Reti <gilad.reti@gmail.com>
Wed, 13 Jan 2021 05:38:08 +0000 (07:38 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 14 Jan 2021 03:47:44 +0000 (19:47 -0800)
commitb665185406e4c977a393224864ac8c65995d70d1
treec51f271b9d313f4b557fbc8f472dabe68da473e7
parent38898abecb49b559fa671cd71313519f3e66ad19
selftests/bpf: Add verifier test for PTR_TO_MEM spill

Add a test to check that the verifier is able to recognize spilling of
PTR_TO_MEM registers, by reserving a ringbuf buffer, forcing the spill
of a pointer holding the buffer address to the stack, filling it back
in from the stack and writing to the memory area pointed by it.

The patch was partially contributed by CyberArk Software, Inc.

Signed-off-by: Gilad Reti <gilad.reti@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: KP Singh <kpsingh@kernel.org>
Link: https://lore.kernel.org/bpf/20210113053810.13518-2-gilad.reti@gmail.com
tools/testing/selftests/bpf/test_verifier.c
tools/testing/selftests/bpf/verifier/spill_fill.c