All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v2] sched/psi: Fix psimon fork deadlock and rtpoll_timer UAF
@ 2026-07-12 17:46 Tejun Heo
  2026-07-12 17:46 ` [PATCH 1/2] sched/psi: Create the psimon kthread outside of cgroup_mutex Tejun Heo
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Tejun Heo @ 2026-07-12 17:46 UTC (permalink / raw)
  To: Matt Fleming
  Cc: David Vernet, Andrea Righi, Changwoo Min, Johannes Weiner,
	Suren Baghdasaryan, Peter Zijlstra, Edward Adam Davis,
	Chen Ridong, Zhaoyang Huang, ziwei . dai, ke . wang, Matt Fleming,
	sched-ext, cgroups, linux-kernel, stable, kernel-team, Tejun Heo

Hello,

v2: - Retagged sched/psi (was cgroup) (patch 1).
    - Added a fix for a pre-existing rtpoll_timer use-after-free that the
      Sashiko AI review flagged on the previous posting (patch 2).

v1: https://lore.kernel.org/r/20260710134945-psimon-fix-tj@kernel.org

a5b98009f16d ("sched/psi: fix race between file release and pressure
write") made pressure_write() fork the psimon kthread while holding
cgroup_mutex, which deadlocks against the sched_ext enable path blocking
forks before grabbing cgroup_mutex. Patch 1 moves the fork outside
cgroup_mutex. Patch 2 fixes the use-after-free from a schedule attempt
re-arming group->rtpoll_timer behind psi_trigger_destroy() by shutting
down the timer when the group is freed.

Matt, patch 1 is unchanged from the previous posting except for the
subject prefix, so test results against that posting still apply.

Peter, once these are reviewed and tested, how do you want them routed?
I can take them through the cgroup tree if that works for you.

Patches:

  [PATCH 1/2] sched/psi: Create the psimon kthread outside of cgroup_mutex
  [PATCH 2/2] sched/psi: Shut down rtpoll_timer in psi_cgroup_free()

Based on cgroup/for-7.2-fixes (97fef6025844).

 include/linux/psi.h    |  4 ++-
 kernel/cgroup/cgroup.c | 23 +++++++++++++++-
 kernel/sched/psi.c     | 75 +++++++++++++++++++++++++++++++++++++++-----------
 3 files changed, 84 insertions(+), 18 deletions(-)

Thanks.

--
tejun

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

end of thread, other threads:[~2026-07-13 15:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-12 17:46 [PATCHSET v2] sched/psi: Fix psimon fork deadlock and rtpoll_timer UAF Tejun Heo
2026-07-12 17:46 ` [PATCH 1/2] sched/psi: Create the psimon kthread outside of cgroup_mutex Tejun Heo
2026-07-12 18:00   ` sashiko-bot
2026-07-12 20:26     ` Tejun Heo
2026-07-13 10:51   ` Johannes Weiner
2026-07-13 13:48   ` Matt Fleming
2026-07-13 15:19     ` Suren Baghdasaryan
2026-07-12 17:46 ` [PATCH 2/2] sched/psi: Shut down rtpoll_timer in psi_cgroup_free() Tejun Heo
2026-07-13 10:56   ` Johannes Weiner
2026-07-13 14:07     ` Suren Baghdasaryan
2026-07-13 15:19       ` Suren Baghdasaryan
2026-07-13 13:48   ` Matt Fleming
2026-07-13 13:49 ` [PATCHSET v2] sched/psi: Fix psimon fork deadlock and rtpoll_timer UAF Matt Fleming

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.