BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>, bpf@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Emil Tsalapatis	 <emil@etsalapatis.com>,
	Amery Hung <ameryhung@gmail.com>,
	kkd@meta.com, 	kernel-team@meta.com
Subject: Re: [PATCH bpf-next v4 5/8] bpf: Fix generic __uninit kfunc output buffers
Date: Fri, 18 Sep 2026 10:50:04 -0700	[thread overview]
Message-ID: <0382b5c8e673d44797136a4043cf02d28b6720a1.camel@gmail.com> (raw)
In-Reply-To: <20260918052906.12226-6-memxor@gmail.com>

On Fri, 2026-09-18 at 07:28 +0200, Kumar Kartikeya Dwivedi wrote:
> Stack liveness treats __uninit kfunc arguments as writes. Even with
> write-only access checks, ordinary clobber handling leaves poisoned stack
> bytes poisoned after the call, so the output cannot be read.
> 
> Reuse the helper output descriptor for generic kfunc buffers. Record the
> output after resolving its memory type, and initialize its stack bytes
> only after all arguments have been checked. This prevents an output from
> making an aliased, uninitialized input appear valid.
> 
> Track the output by its ABI argument slot, since a kfunc pointer may be
> passed on the stack or follow a multi-slot by-value argument. Keep the
> single-output restriction in prototype validation; multiple-output
> tracking is a separate extension.
> 
> Document that output buffers must be fully initialized on every return
> path, including error returns and padding.
> 
> Fixes: 2cb27158adb3 ("bpf: poison dead stack slots")
> Reported-by: Tejun Heo <tj@kernel.org>
> Link: https://lore.kernel.org/bpf/86d966ec88bbf27d21b2bb4e18c8aa00@kernel.org
> Suggested-by: Eduard Zingerman <eddyz87@gmail.com>
> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> ---

Acked-by: Eduard Zingerman <eddyz87@gmail.com>

  parent reply	other threads:[~2026-09-18 17:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18  5:28 [PATCH bpf-next v4 0/8] Fix generic __uninit kfunc output buffers Kumar Kartikeya Dwivedi
2026-09-18  5:28 ` [PATCH bpf-next v4 1/8] selftests/bpf: Allow privileged preparation for capability tests Kumar Kartikeya Dwivedi
2026-09-18  5:28 ` [PATCH bpf-next v4 2/8] bpf: Record raw memory arguments during argument checking Kumar Kartikeya Dwivedi
2026-09-18  6:35   ` bot+bpf-ci
2026-09-18 16:24     ` Eduard Zingerman
2026-09-18  5:28 ` [PATCH bpf-next v4 3/8] bpf: Check read access for initialized writable memory arguments Kumar Kartikeya Dwivedi
2026-09-18  5:50   ` sashiko-bot
2026-09-18 17:46     ` Eduard Zingerman
2026-09-18 18:01     ` Amery Hung
2026-09-18  5:28 ` [PATCH bpf-next v4 4/8] selftests/bpf: Cover helper memory access permissions Kumar Kartikeya Dwivedi
2026-09-18  6:17   ` bot+bpf-ci
2026-09-18  5:28 ` [PATCH bpf-next v4 5/8] bpf: Fix generic __uninit kfunc output buffers Kumar Kartikeya Dwivedi
2026-09-18  6:35   ` bot+bpf-ci
2026-09-18 17:50   ` Eduard Zingerman [this message]
2026-09-18  5:29 ` [PATCH bpf-next v4 6/8] selftests/bpf: Cover generic __uninit output initialization Kumar Kartikeya Dwivedi
2026-09-18  5:29 ` [PATCH bpf-next v4 7/8] bpf: Support multiple __uninit kfunc output arguments Kumar Kartikeya Dwivedi
2026-09-18  5:29 ` [PATCH bpf-next v4 8/8] selftests/bpf: Cover __uninit kfunc output argument slots Kumar Kartikeya Dwivedi
2026-09-18  6:35   ` 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=0382b5c8e673d44797136a4043cf02d28b6720a1.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=ameryhung@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=emil@etsalapatis.com \
    --cc=kernel-team@meta.com \
    --cc=kkd@meta.com \
    --cc=memxor@gmail.com \
    --cc=tj@kernel.org \
    /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