selftests/bpf: check if verifier tracks constants spilled by BPF_ST_MEM
authorEduard Zingerman <eddyz87@gmail.com>
Tue, 14 Feb 2023 23:20:28 +0000 (01:20 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 15 Feb 2023 19:48:47 +0000 (11:48 -0800)
commit1a24af65bb5fed673a9377e794ee3cf416fec64d
treef35daec7c6f523270757f40f9b0a30cb85ba6130
parentecdf985d7615356b78241fdb159c091830ed0380
selftests/bpf: check if verifier tracks constants spilled by BPF_ST_MEM

Check that verifier tracks the value of 'imm' spilled to stack by
BPF_ST_MEM instruction. Cover the following cases:
- write of non-zero constant to stack;
- write of a zero constant to stack.

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20230214232030.1502829-3-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/verifier/bpf_st_mem.c [new file with mode: 0644]