Skip to content

Fix verifier test failures in verbose mode

Gregory Bell bpf 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2selftests/bpf: test_verifier verbose causes erroneous failurestools/testing/selftests/bpf/test_verifier.c+3 -30 repliesApplied
2/2selftests/bpf: test_verifier verbose log overflowstools/testing/selftests/bpf/test_verifier.c+1 -10 repliesApplied

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchEduard Zingerman
SeriesT-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH bpf-next 0/2] Fix verifier test failures in verbose mode

This patch series fixes two issues that cause false failures in the BPF verifier test suite when run with verbose output (-v).

The following tests fail only when running the test_verifier in verbose.

#458/p ld_dw: xor semi-random 64 bit imms, test 5 FAIL #494/p precise: test 1 FAIL
#495/p precise: test 2 FAIL
#497/p precise: ST zero to stack insn is supported FAIL #498/p precise: STX insn causing spi > allocated_stack FAIL #501/p scale: scale test 1 FAIL
#502/p scale: scale test 2 FAIL

This leads to inconsistent results across verbose and non-verbose runs.

Patch 1 addresses an issue where the verbose flag (-v) unintentionally overrides the opts.log_level, leading to incorrect contents when checking bpf_vlog in tests with expected_ret == VERBOSE_ACCEPT. This occurs when running verbose with -v but not -vv

Patch 2 increases the size of the bpf_vlog[] buffer to prevent truncation of large verifier logs, which was causing failures in several scale and 64-bit immediate tests.

Before patches:
./test_verifier | grep FAIL
Summary: 790 PASSED, 0 SKIPPED, 0 FAILED

./test_verifier -v | grep FAIL
#115/p BPF_ST_MEM stack imm sign FAIL
#458/p ld_dw: xor semi-random 64 bit imms, test 5 FAIL #494/p precise: test 1 FAIL
#495/p precise: test 2 FAIL
#497/p precise: ST zero to stack insn is supported FAIL #498/p precise: STX insn causing spi > allocated_stack FAIL #501/p scale: scale test 1 FAIL
#502/p scale: scale test 2 FAIL
Summary: 782 PASSED, 0 SKIPPED, 8 FAILED

./test_verifier -vv | grep FAIL
#458/p ld_dw: xor semi-random 64 bit imms, test 5 FAIL #501/p scale: scale test 1 FAIL
#502/p scale: scale test 2 FAIL
Summary: 787 PASSED, 0 SKIPPED, 3 FAILED

After patches:
./test_verifier -v | grep FAIL
Summary: 790 PASSED, 0 SKIPPED, 0 FAILED
./test_verifier -vv | grep FAIL
Summary: 790 PASSED, 0 SKIPPED, 0 FAILED

These fixes improve test reliability and ensure consistent behavior across verbose and non-verbose runs.

Gregory Bell (2):
selftests/bpf: test_verifier verbose causes erroneous failures selftests/bpf: test_verifier verbose log overflows

 tools/testing/selftests/bpf/test_verifier.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.49.0