diff options
author | Paul Chaignon <paul@isovalent.com> | 2021-12-10 00:47:00 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-12-10 18:13:21 +0100 |
commit | 0be2516f865f5a876837184a8385163ff64a5889 (patch) | |
tree | 5dd13b7d8a936e6f582c388cdfa35288182cfdfc /net | |
parent | bpf: Fix incorrect state pruning for <8B spill/fill (diff) | |
download | linux-0be2516f865f5a876837184a8385163ff64a5889.tar.xz linux-0be2516f865f5a876837184a8385163ff64a5889.zip |
selftests/bpf: Tests for state pruning with u32 spill/fill
This patch adds tests for the verifier's tracking for spilled, <8B
registers. The first two test cases ensure the verifier doesn't
incorrectly prune states in case of <8B spill/fills. The last one simply
checks that a filled u64 register is marked unknown if the register
spilled in the same slack slot was less than 8B.
The map value access at the end of the first program is only incorrect
for the path R6=32. If the precision bit for register R8 isn't
backtracked through the u32 spill/fill, the R6=32 path is pruned at
instruction 9 and the program is incorrectly accepted. The second
program is a variation of the same with u32 spills and a u64 fill.
The additional instructions to introduce the first pruning point may be
a bit fragile as they depend on the heuristics for pruning points in the
verifier (currently at least 8 instructions and 2 jumps). If the
heuristics are changed, the pruning point may move (e.g., to the
subsequent jump) or disappear, which would cause the test to always pass.
Signed-off-by: Paul Chaignon <paul@isovalent.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions