[PATCH] landlock: Do not hold exec_update_lock across the TSYNC wait

sashiko-bot at kernel.org sashiko-bot at kernel.org
Fri Nov 20 15:22:19 UTC 2026


> landlock_restrict_sibling_threads() write-locks
> current->signal->exec_update_lock to serialize TSYNC callers, and holds
> it until every sibling thread has run its task_work.  This wait is
> unbounded: TWA_SIGNAL does not wake a TASK_KILLABLE sleeper, so a
> sibling blocked as a vfork() parent runs it only once its child execs or
> exits.
> 
> Meanwhile, readers of this lock block, mostly in D state:
> /proc/<pid>/stat, mm_access(), pidfd_getfd(), kcmp(), perf_event_open(),
> etc.  An unprivileged process can thus stall tools run by other users,
> including root, such as ps and top.
> 
> Only a per-process "TSYNC in progress" marker is needed.  Use an unused
> signal_struct.flags bit, protected by sighand->siglock, which is held
> only to set or clear the marker.  A second caller still restarts the
> [ ... ]
> Cc: stable at vger.kernel.org
> Reported-by: Lee Seong Hyeon <ihopenre at gmail.com>
> Suggested-by: Lee Seong Hyeon <ihopenre at gmail.com>
> Fixes: ff88df67dbf7 ("landlock: Serialize TSYNC thread restriction")
> Signed-off-by: Mickaël Salaün <mic at digikod.net>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120151554.2651743-1-mic@digikod.net?part=1




More information about the Linux-security-module-archive mailing list