BPF List
 help / color / mirror / Atom feed
* [PATCH 0/3] fork, exit: fix BPF use-after-frees on task pointers
@ 2026-12-03 20:06 Chris Mason
  2026-12-03 20:06 ` [PATCH 1/3] fork: make the creator the parent of an unlinked task Chris Mason
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Chris Mason @ 2026-12-03 20:06 UTC (permalink / raw)
  To: brauner, oleg, ast, daniel, andrii, bpf, linux-kernel
  Cc: akpm, peterz, mingo, kees, tj, eddyz87, memxor, yonghong.song,
	martin.lau, song, jolsa, emil, ihor.solodrai, sched-ext, mason

Hi everyone,

These are AI generated fixes for a few ways that BPF programs can follow
task_struct pointers into freed memory.

Patch 1 fixes the parent pointers of new tasks and idle tasks, patch 2
fixes the parent and leader pointers of released tasks, and patch 3 stops
the BPF thread iterator from starting at a released task.

Patch 2 makes a released thread hold a reference on its group leader,
which I don't love.  If there are better ideas, I'm happy to get
the bots cranking on them.

Chris Mason (3):
  fork: make the creator the parent of an unlinked task
  exit: don't leave stale parent and leader pointers
  bpf: Don't start a thread walk at a released task

 kernel/bpf/task_iter.c |  3 +++
 kernel/exit.c          | 22 +++++++++++++++++++++-
 kernel/fork.c          | 40 ++++++++++++++++++++++++++--------------
 3 files changed, 50 insertions(+), 15 deletions(-)


base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
-- 
2.55.0


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

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

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 20:06 [PATCH 0/3] fork, exit: fix BPF use-after-frees on task pointers Chris Mason
2026-12-03 20:06 ` [PATCH 1/3] fork: make the creator the parent of an unlinked task Chris Mason
2026-12-03 20:31   ` sashiko-bot
2026-12-03 20:06 ` [PATCH 2/3] exit: don't leave stale parent and leader pointers Chris Mason
2026-12-03 20:31   ` sashiko-bot
2026-12-03 20:55   ` bot+bpf-ci
2026-12-03 20:06 ` [PATCH 3/3] bpf: Don't start a thread walk at a released task Chris Mason
2026-12-03 20:42   ` bot+bpf-ci

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