From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
To: bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>
Subject: [PATCH bpf v1 0/3] Two more fixes for check_max_stack_depth
Date: Thu, 13 Jul 2023 06:01:15 +0530 [thread overview]
Message-ID: <20230713003118.1327943-1-memxor@gmail.com> (raw)
I noticed two more bugs while reviewing the code, description and
examples available in the patches.
One leads to incorrect subprog index to be stored in the frame stack
maintained by the function (leading to incorrect tail_call_reachable
marks, among other things).
The other problem is missing exploration pass of other async callbacks
when they are not called from the main prog. Call chains rooted at them
can thus bypass the stack limits (32 call frames * max permitted stack
depth per function).
Kumar Kartikeya Dwivedi (3):
bpf: Fix subprog idx logic in check_max_stack_depth
bpf: Repeat check_max_stack_depth for async callbacks
selftests/bpf: Add more tests for check_max_stack_depth bug
kernel/bpf/verifier.c | 32 +++++++++++++++----
.../selftests/bpf/progs/async_stack_depth.c | 25 +++++++++++++--
2 files changed, 48 insertions(+), 9 deletions(-)
base-commit: 2e06c57d66d3f6c26faa5f5b479fb3add34ce85a
--
2.40.1
next reply other threads:[~2023-07-13 0:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 0:31 Kumar Kartikeya Dwivedi [this message]
2023-07-13 0:31 ` [PATCH bpf v1 1/3] bpf: Fix subprog idx logic in check_max_stack_depth Kumar Kartikeya Dwivedi
2023-07-13 0:31 ` [PATCH bpf v1 2/3] bpf: Repeat check_max_stack_depth for async callbacks Kumar Kartikeya Dwivedi
2023-07-14 21:48 ` Alexei Starovoitov
2023-07-17 16:16 ` Kumar Kartikeya Dwivedi
2023-07-13 0:31 ` [PATCH bpf v1 3/3] selftests/bpf: Add more tests for check_max_stack_depth bug 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=20230713003118.1327943-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=martin.lau@linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).