]> 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)
commit83f7ec246ea008857846a2efa191cf9ae6cd6f8e
treec51f271b9d313f4b557fbc8f472dabe68da473e7
parent81500e2d2f574b88b9f2b1525dedb4c614e91502
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