From: Chris Mason <mason@kernel.org>
To: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
andrii@kernel.org, jolsa@kernel.org, song@kernel.org
Cc: eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev,
yonghong.song@linux.dev, emil@etsalapatis.com,
ihor.solodrai@linux.dev, rostedt@goodmis.org,
mhiramat@kernel.org, mathieu.desnoyers@efficios.com,
mjambigi@linux.ibm.com, petr.pavlu@suse.com,
linux-trace-kernel@vger.kernel.org,
linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org,
mason@kernel.org
Subject: [PATCH bpf 0/2] bpf: don't attach links to modules that are still loading
Date: Thu, 3 Dec 2026 15:26:15 -0500 [thread overview]
Message-ID: <20261203202617.31741-1-mason@kernel.org> (raw)
Hi everyone,
These are AI generated fixes for two use-after-frees in BPF links.
When a module fails to load, we free it without checking for references.
If somebody creates a link while it's still loading, the link is left
pointing at freed memory. With these applied, the link fails until the
module is live.
Mahanta Jambigi has a patch that makes the module loader wait for those
references instead:
[PATCH v2] module: drain external refs before freeing a failed-init module
https://lore.kernel.org/all/20261201103922.1480284-1-mjambigi@linux.ibm.com/
It doesn't cover all of the ways a load can fail, and an open link could
make it wait forever, so I think we need both.
This is on top of v7.4-rc5.
Chris Mason (2):
bpf: Reject raw tracepoint links on coming modules
bpf: Reject kprobe_multi links on coming modules
kernel/trace/bpf_trace.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
--
2.55.0
next reply other threads:[~2026-12-03 20:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 20:26 Chris Mason [this message]
2026-12-03 20:26 ` [PATCH bpf 1/2] bpf: Reject raw tracepoint links on coming modules Chris Mason
2026-12-03 20:26 ` [PATCH bpf 2/2] bpf: Reject kprobe_multi " Chris Mason
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=20261203202617.31741-1-mason@kernel.org \
--to=mason@kernel.org \
--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=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mathieu.desnoyers@efficios.com \
--cc=memxor@gmail.com \
--cc=mhiramat@kernel.org \
--cc=mjambigi@linux.ibm.com \
--cc=petr.pavlu@suse.com \
--cc=rostedt@goodmis.org \
--cc=song@kernel.org \
--cc=yonghong.song@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