[PATCH 0/2] exec: two more sleepers in the way of exec
From: Christian Brauner
Date: Thu Nov 26 2026 - 06:46:08 EST
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@xxxxxxxxxx>
---
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