Re: [RFC 1/2] landlock: Multithreading support for landlock_restrict_self()
From: "Günther Noack" <gnoack@google.com>
Date: 2025-06-12 11:51:59
Also in:
lkml
From: "Günther Noack" <gnoack@google.com>
Date: 2025-06-12 11:51:59
Also in:
lkml
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:quoted
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