BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v1 0/3] Fix missing process_iter_arg type check
@ 2024-11-27 23:01 Kumar Kartikeya Dwivedi
  2024-11-27 23:01 ` [PATCH bpf-next v1 1/3] bpf: Ensure reg is PTR_TO_STACK in process_iter_arg Kumar Kartikeya Dwivedi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kumar Kartikeya Dwivedi @ 2024-11-27 23:01 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Martin KaFai Lau, Eduard Zingerman, Tao Lyu, Mathias Payer,
	Meng Xu, Sanidhya Kashyap

I am taking over Tao's earlier patch set that can be found at [0], after
an offline discussion. The bug reported in that thread is that
process_iter_arg missed a reg->type == PTR_TO_STACK check. Fix this by
adding it in, and also address comments from Andrii on the earlier
attempt. Include more selftests to ensure the error is caught.

  [0]: https://lore.kernel.org/bpf/20241107214736.347630-1-tao.lyu@epfl.ch

Kumar Kartikeya Dwivedi (2):
  bpf: Zero index arg error string for dynptr and iter
  selftests/bpf: Add tests for iter arg check

Tao Lyu (1):
  bpf: Ensure reg is PTR_TO_STACK in process_iter_arg

 kernel/bpf/verifier.c                         | 17 +++++++-----
 .../testing/selftests/bpf/progs/dynptr_fail.c | 22 ++++++++--------
 tools/testing/selftests/bpf/progs/iters.c     | 26 +++++++++++++++++++
 .../selftests/bpf/progs/iters_state_safety.c  | 14 +++++-----
 .../selftests/bpf/progs/iters_testmod_seq.c   |  4 +--
 .../bpf/progs/test_kfunc_dynptr_param.c       |  2 +-
 .../selftests/bpf/progs/verifier_bits_iter.c  |  8 +++---
 7 files changed, 62 insertions(+), 31 deletions(-)


base-commit: c8d02b547363880d996f80c38cc8b997c7b90725
-- 
2.43.5


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

end of thread, other threads:[~2024-11-29  0:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-27 23:01 [PATCH bpf-next v1 0/3] Fix missing process_iter_arg type check Kumar Kartikeya Dwivedi
2024-11-27 23:01 ` [PATCH bpf-next v1 1/3] bpf: Ensure reg is PTR_TO_STACK in process_iter_arg Kumar Kartikeya Dwivedi
2024-11-27 23:01 ` [PATCH bpf-next v1 2/3] bpf: Zero index arg error string for dynptr and iter Kumar Kartikeya Dwivedi
2024-11-27 23:06   ` Kumar Kartikeya Dwivedi
2024-11-29  0:20     ` Kumar Kartikeya Dwivedi
2024-11-27 23:01 ` [PATCH bpf-next v1 3/3] selftests/bpf: Add tests for iter arg check Kumar Kartikeya Dwivedi

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