All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Hwang <leon.hwang@linux.dev>
To: Junseo Lim <zirajs7@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	bpf@vger.kernel.org, Sechang Lim <rhkrqnwk98@gmail.com>,
	"Paul E. McKenney" <paulmck@kernel.org>
Subject: Re: [PATCH bpf v2] bpf: keep trampoline progs alive until image release
Date: Thu, 20 Aug 2026 17:26:18 +0800	[thread overview]
Message-ID: <14c836d6-8919-40f8-8559-bd6048c14316@linux.dev> (raw)
In-Reply-To: <20260820022831.18601-1-zirajs7@gmail.com>

Hi Junseo,

On 20/8/26 10:28, Junseo Lim wrote:
> arch_prepare_bpf_trampoline() embeds program pointers in the generated
> image and passes them to __bpf_prog_enter_recur(). After
> bpf_trampoline_update() replaces the image, bpf_tramp_image_put() can keep
> the old image executable past a normal RCU grace period.
> 
> A detached non-sleepable prog can therefore be freed before a preempted
> task reaches rcu_read_lock_dont_migrate() in __bpf_prog_enter_recur(),
> leading to a use-after-free.
> 
> Keep image-local prog refs and drop them from bpf_tramp_image_free().
> 
> Fixes: e21aa341785c ("bpf: Fix fexit trampoline.")

There was an existing fix [1]. Could you take a look at that fix?

[1]
https://lore.kernel.org/bpf/20260819122252.1782790-1-florent.revest@linux.dev/

Thanks,
Leon

> Reported-by: Sechang Lim <rhkrqnwk98@gmail.com>
> Signed-off-by: Junseo Lim <zirajs7@gmail.com>
> --- [...]

      parent reply	other threads:[~2026-08-20  9:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20  2:28 [PATCH bpf v2] bpf: keep trampoline progs alive until image release Junseo Lim
2026-08-20  2:42 ` sashiko-bot
2026-08-20  3:35 ` bot+bpf-ci
2026-08-20  9:26 ` Leon Hwang [this message]

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=14c836d6-8919-40f8-8559-bd6048c14316@linux.dev \
    --to=leon.hwang@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=rhkrqnwk98@gmail.com \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    --cc=zirajs7@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.