[RFC 1/2] landlock: Multithreading support for landlock_restrict_self()

Günther Noack gnoack at google.com
Thu Jun 12 11:51:55 UTC 2025


On Mon, Jun 02, 2025 at 08:45:06AM +0200, Mickaël Salaün wrote:
> On Fri, May 30, 2025 at 06:26:07PM +0200, Günther Noack wrote:
> >      As Jann pointed out in [1], the tasklist_lock and siglock are not sleepable
> >      and can't be used while waiting, which is why he proposed an approach where
> >      we retry in a loop until no new threads show up any more, while getting the
> >      existing threads stuck in the task_work as well (where they can't spawn new
> >      threads).
> 
> This looks good.  Too bad we need to block all threads.

OK, I'll take that route then.

In my understanding, if we are already blocking all threads, we might as well
use prepare_creds() in these threads again. -- It does not cost us much more to
collect these potential errors now.  Does that sound reasonable?

—Günther



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