selftests/bpf: States pruning checks for scalar vs STACK_MISC
authorEduard Zingerman <eddyz87@gmail.com>
Sat, 27 Jan 2024 17:52:37 +0000 (19:52 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 2 Feb 2024 21:22:14 +0000 (13:22 -0800)
commit73a28d9d000e8d20b4b3c516b74ee92afe3ae4be
tree3fc8bcaba15ec02e57e63eb576acba505394dd84
parent6efbde200bf3cf2dbf6e7181893fed13a79c789b
selftests/bpf: States pruning checks for scalar vs STACK_MISC

Check that stacksafe() compares spilled scalars with STACK_MISC.
The following combinations are explored:
- old spill of imprecise scalar is equivalent to cur STACK_{MISC,INVALID}
  (plus error in unpriv mode);
- old spill of precise scalar is not equivalent to cur STACK_MISC;
- old STACK_MISC is equivalent to cur scalar;
- old STACK_MISC is not equivalent to cur non-scalar.

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240127175237.526726-7-maxtram95@gmail.com
tools/testing/selftests/bpf/progs/verifier_spill_fill.c