BPF List
 help / color / mirror / Atom feed
* [PATCH bpf 0/3] bpf: Fix missed var_off related to movsx in verifier
@ 2024-06-15 17:46 Yonghong Song
  2024-06-15 17:46 ` [PATCH bpf 1/3] bpf: Add missed var_off setting in set_sext32_default_val() Yonghong Song
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Yonghong Song @ 2024-06-15 17:46 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, kernel-team,
	Martin KaFai Lau

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(+)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-17 17:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-15 17:46 [PATCH bpf 0/3] bpf: Fix missed var_off related to movsx in verifier Yonghong Song
2024-06-15 17:46 ` [PATCH bpf 1/3] bpf: Add missed var_off setting in set_sext32_default_val() Yonghong Song
2024-06-15 17:46 ` [PATCH bpf 2/3] bpf: Add missed var_off setting in coerce_subreg_to_size_sx() Yonghong Song
2024-06-15 17:46 ` [PATCH bpf 3/3] selftests/bpf: Add a few tests to cover Yonghong Song
2024-06-17 17:42 ` [PATCH bpf 0/3] bpf: Fix missed var_off related to movsx in verifier Eduard Zingerman
2024-06-17 17:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox