Skip to content

bpf: Fix missed var_off related to movsx in verifier

Yonghong Song bpf 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: Add missed var_off setting in set_sext32_default_val()kernel/bpf/verifier.c+1 -00 repliesApplied
2/3bpf: Add missed var_off setting in coerce_subreg_to_size_sx()kernel/bpf/verifier.c+1 -00 repliesApplied
3/3selftests/bpf: Add a few tests to covertools/testing/selftests/bpf/progs/verifier_movsx.c+63 -00 repliesApplied

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchEduard Zingerman
SeriesA-b
1/3
2/3
3/3

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 0/3] bpf: Fix missed var_off related to movsx in verifier

Zac reported a verification issue ([1]) where verification unexpectedly succeeded. This is due to missing proper var_off setting in verifier related to movsx insn. I found another similar issue as well. This patch set fixed both problems and added three inline asm tests to test these fixes.

[1] https://lore.kernel.org/bpf/CAADnVQLPU0Shz7dWV4bn2BgtGdxN3uFHPeobGBA72tpg5Xoykw@mail.gmail.com/

Yonghong Song (3):
bpf: Add missed var_off setting in set_sext32_default_val()
bpf: Add missed var_off setting in coerce_subreg_to_size_sx() selftests/bpf: Add a few tests to cover

 kernel/bpf/verifier.c                         |  2 +
 .../selftests/bpf/progs/verifier_movsx.c      | 63 +++++++++++++++++++
 2 files changed, 65 insertions(+)
Signature · 1 line
2.43.0