Linux Modules
 help / color / mirror / Atom feed
* [PATCH bpf 0/2] bpf: don't attach links to modules that are still loading
@ 2026-12-03 20:26 Chris Mason
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Mason @ 2026-12-03 20:26 UTC (permalink / raw)
  To: bpf, ast, daniel, andrii, jolsa, song
  Cc: eddyz87, memxor, martin.lau, yonghong.song, emil, ihor.solodrai,
	rostedt, mhiramat, mathieu.desnoyers, mjambigi, petr.pavlu,
	linux-trace-kernel, linux-modules, linux-kernel, mason

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-03 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 20:26 [PATCH bpf 0/2] bpf: don't attach links to modules that are still loading Chris Mason
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox