[PATCH v2] landlock: Do not hold exec_update_lock across the TSYNC wait
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Mon Nov 30 14:43:49 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
> [ ... ]
> Acked-by: Christian Brauner (Amutable) <brauner at kernel.org>
> Acked-by: Günther Noack <gnoack at google.com>
> Reviewed-by: Oleg Nesterov <oleg at redhat.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/20261130143603.512171-1-mic@digikod.net?part=1
More information about the Linux-security-module-archive
mailing list