From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
To: bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>, Tao Lyu <tao.lyu@epfl.ch>,
Mathias Payer <mathias.payer@nebelwelt.net>,
Meng Xu <meng.xu.cs@uwaterloo.ca>,
Sanidhya Kashyap <sanidhya.kashyap@epfl.ch>
Subject: [PATCH bpf-next v1 0/3] Fix missing process_iter_arg type check
Date: Wed, 27 Nov 2024 15:01:44 -0800 [thread overview]
Message-ID: <20241127230147.4158201-1-memxor@gmail.com> (raw)
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
next reply other threads:[~2024-11-27 23:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-27 23:01 Kumar Kartikeya Dwivedi [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241127230147.4158201-1-memxor@gmail.com \
--to=memxor@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=martin.lau@kernel.org \
--cc=mathias.payer@nebelwelt.net \
--cc=meng.xu.cs@uwaterloo.ca \
--cc=sanidhya.kashyap@epfl.ch \
--cc=tao.lyu@epfl.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox