All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>, <bpf@vger.kernel.org>
Cc: "Andrii Nakryiko" <andrii@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Eduard Zingerman" <eddyz87@gmail.com>,
	"Emil Tsalapatis" <emil@etsalapatis.com>, <kkd@meta.com>,
	<kernel-team@meta.com>
Subject: Re: [PATCH bpf-next v1 1/3] bpf: Check fastcall contract for helper and kfunc stack buffers
Date: Thu, 24 Sep 2026 05:55:09 +0000	[thread overview]
Message-ID: <DLNBBR9198NM.1OAVB1QAY5UG8@gmail.com> (raw)
In-Reply-To: <20260923084201.2437625-2-memxor@gmail.com>

On Wed, Sep 23, 2026 at 10:41 AM Kumar Kartikeya Dwivedi <memxor@gmail.com> wrote:
> +	/*
> +	 * Helpers and kfuncs can access stack slots without going through the
> +	 * regular stack read/write paths, including when raw mode is disabled.
> +	 */
> +	if (access_size)
> +		check_fastcall_stack_contract(env, state, env->insn_idx, min_off);

can we do it once in check_stack_access_within_bounds() ?
Both check_mem_access() and check_stack_range_initialized() call it
first, and it already has the frame that owns the slot and min_off.
Then the other four check_fastcall_stack_contract() calls can go
and patch 2 is not needed.

  reply	other threads:[~2026-09-24  5:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  8:41 [PATCH bpf-next v1 0/3] Fix fastcall rewrite with indirect stack accesses Kumar Kartikeya Dwivedi
2026-09-23  8:41 ` [PATCH bpf-next v1 1/3] bpf: Check fastcall contract for helper and kfunc stack buffers Kumar Kartikeya Dwivedi
2026-09-24  5:55   ` Alexei Starovoitov [this message]
2026-09-23  8:41 ` [PATCH bpf-next v1 2/3] bpf: Check fastcall contract of the frame a stack read targets Kumar Kartikeya Dwivedi
2026-09-23  8:41 ` [PATCH bpf-next v1 3/3] selftests/bpf: Test fastcall rewrite with indirect stack accesses Kumar Kartikeya Dwivedi
2026-09-23  9:33   ` bot+bpf-ci

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=DLNBBR9198NM.1OAVB1QAY5UG8@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=kernel-team@meta.com \
    --cc=kkd@meta.com \
    --cc=memxor@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.