Re: [PATCH v2 23/31] mm/mempolicy: check access under exec_update_lock

From: Oleg Nesterov

Date: Sat Dec 05 2026 - 08:26:15 EST


On 12/05, sashiko-bot@xxxxxxxxxx wrote:
>
> > --- a/mm/mempolicy.c
> > +++ b/mm/mempolicy.c
> > @@ -1981,6 +1981,12 @@ static int kernel_migrate_pages(pid_t pid, unsigned long maxnode,
> > goto out;
> > }
> > get_task_struct(task);
> > + rcu_read_unlock();
> > +
> > + /* Exclude execve() until we have grabbed the MM from this task. */
> > + err = down_read_killable(&task->signal->exec_update_lock);
> > + if (err)
> > + goto out_put;
>
> [Severity: High]
> Can taking task->signal->exec_update_lock unconditionally here deadlock with
> Landlock thread synchronization when migrating the calling process or a
> sibling thread?

Another reason to avoid exec_update_lock in landlock_restrict_sibling_threads().

Mickaël is working on the patch:

[PATCH v3] landlock: Do not hold exec_update_lock across the TSYNC wait
https://lore.kernel.org/all/20261204111754.1452982-1-mic@xxxxxxxxxxx/

Oleg.