All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Florent Revest (Anthropic)" <florent.revest@linux.dev>
Cc: "Heiko Carstens" <hca@linux.ibm.com>,
	bpf@vger.kernel.org, "Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH bpf v5 2/3] bpf: Skip detached progs in trampoline images that are still in use
Date: Sat, 26 Sep 2026 14:09:58 +0000	[thread overview]
Message-ID: <20260926140959.530F11F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260926135605.1217928-3-florent.revest@linux.dev>

> bpf_tramp_image_put() makes sure a trampoline image is not freed while
> a task may still be running in it, but nothing similar is done for the
> progs called by that image. Detach drops the last prog reference right
> away and the prog is freed after grace periods, on the basis that a
> task still in the traced function skips the fexit progs once the nop at
> ip_after_call is patched to a jump.
> 
> That leaves out a task sleeping in a sleepable prog that runs before
> the detached one, which no grace period waits for:
> 
>   CPU 0                               CPU 1
>   in image I, sleeping in prog S
>                                       detach P from I's trampoline
>                                        -> new image, bpf_tramp_image_put(I)
>                                       bpf_prog_put(P), last ref
> [ ... ]
> Reported-by: Sechang Lim <rhkrqnwk98@gmail.com>
> Closes: https://lore.kernel.org/bpf/20260815071927.147049-1-zirajs7@gmail.com/
> Suggested-by: Alexei Starovoitov <ast@kernel.org>
> Assisted-by: Claude:unspecified
> Signed-off-by: Florent Revest (Anthropic) <florent.revest@linux.dev>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260926135605.1217928-1-florent.revest@linux.dev?part=2


  reply	other threads:[~2026-09-26 14:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26 13:55 [PATCH bpf v5 0/3] bpf: Fix use-after-free of progs detached from busy trampolines Florent Revest (Anthropic)
2026-09-26 13:55 ` Florent Revest (Anthropic)
2026-09-26 13:55 ` [PATCH bpf v5 1/3] bpf: Wait for an RCU tasks grace period before freeing trampoline progs Florent Revest (Anthropic)
2026-09-26 13:55   ` Florent Revest (Anthropic)
2026-09-26 14:07   ` sashiko-bot
2026-09-27 20:41   ` bot+bpf-ci
2026-09-27 20:41     ` bot+bpf-ci
2026-09-27 20:41     ` bot+bpf-ci
2026-09-28  8:50     ` Florent Revest
2026-09-28  8:50       ` Florent Revest
2026-09-26 13:55 ` [PATCH bpf v5 2/3] bpf: Skip detached progs in trampoline images that are still in use Florent Revest (Anthropic)
2026-09-26 13:55   ` Florent Revest (Anthropic)
2026-09-26 14:09   ` sashiko-bot [this message]
2026-09-26 13:56 ` [PATCH bpf v5 3/3] selftests/bpf: Detach a trampoline prog while a task sleeps before it Florent Revest (Anthropic)
2026-09-26 13:56   ` Florent Revest (Anthropic)
2026-09-26 14:01   ` sashiko-bot
2026-09-29  6:20 ` [PATCH bpf v5 0/3] bpf: Fix use-after-free of progs detached from busy trampolines patchwork-bot+netdevbpf
2026-09-29  6:20   ` patchwork-bot+netdevbpf

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=20260926140959.530F11F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=bpf@vger.kernel.org \
    --cc=florent.revest@linux.dev \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=sashiko-reviews@lists.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 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.