Re: deadlock from exec_update_lock and reading procfs

From: Jann Horn

Date: Mon Sep 07 2026 - 17:31:13 EST


On Wed, Sep 2, 2026 at 8:04 PM Jann Horn <jannh@xxxxxxxxxx> wrote:
> On Tue, Sep 1, 2026 at 4:50 PM Benjamin Peterson <benjamin@xxxxxxxxxxx> wrote:
> > After receiving a kernel with 6650527444da ("proc: protect ptrace_may_access() with exec_update_lock (part 1)"), we encountered a new deadlock in a FUSE server. The FUSE server reads /proc/PID/stat in the file flush callback, where PID is the pid of flushing process. This can deadlock in exec_update_lock acquisition when the flushing process is closing O_CLOEXEC files.
>
> Ugh, sorry about that.
>
> #regzbot ^introduced: 6650527444da

This should resolve the issue:
https://lore.kernel.org/r/20260907-cloexec-before-exec-update-lock-v1-1-8018c201a7df@xxxxxxxxxx

If you can easily test the fix on an affected system, it would be nice
if you could give feedback about whether the fix works for you on that
thread.