Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] exec: two more sleepers in the way of exec
@ 2026-11-26 11:45 Christian Brauner
  2026-11-26 11:45 ` [PATCH 1/2] perf: look up address filter files without ctx->mutex held Christian Brauner
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Brauner @ 2026-11-26 11:45 UTC (permalink / raw)
  To: linux-perf-users, linux-fsdevel
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo, Jann Horn,
	linux-kernel, Christian Brauner (Amutable), stable

This fixes two more places where a task sleeps on something userspace
controls with a lock held that exec needs:

* PERF_EVENT_IOC_SET_FILTER looks up the files of address filters with
  the mutex of the perf context held and perf_event_exec() takes that
  mutex with exec_update_lock held. With a file like /proc/<pid>/exe the
  lookup takes exec_update_lock itself and deadlocks with exec.

* Without an MMU a read of /proc/<pid>/stat waits for the mmap lock with
  exec_update_lock held.

I don't have a machine with intel_pt at hand. The perf patch was tested
with a hack that gives the task clock address filters.

What's left in that ioctl is that it takes the mmap lock of the task
with the mutex held to find the mappings of the files.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
Christian Brauner (2):
      perf: look up address filter files without ctx->mutex held
      proc: call task_vsize() without exec_update_lock held

 fs/proc/array.c      | 13 +++++++++++--
 kernel/events/core.c | 36 ++++++++++++++++++++++++++----------
 2 files changed, 37 insertions(+), 12 deletions(-)
---
base-commit: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4
change-id: 20261125-work-exec-update_lock-leftovers-6778785ed04a


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

end of thread, other threads:[~2026-11-26 15:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 11:45 [PATCH 0/2] exec: two more sleepers in the way of exec Christian Brauner
2026-11-26 11:45 ` [PATCH 1/2] perf: look up address filter files without ctx->mutex held Christian Brauner
2026-11-26 15:24   ` Peter Zijlstra

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