freenode
Kernel & Low-Level

Torvalds rejects Landlock fix that adds a core signal flag

The pull for 7.4-rc6 was meant to stop a lock from being held across an unbounded wait; Linus says a security module does not get special flags in the signal structure.

Linus Torvalds has refused a Landlock pull for Linux 7.4-rc6 that would add a per-process flag in core signal state so the security module can serialize credential updates without holding a lock across an unbounded wait.

Mickaël Salaün, Landlock's maintainer, asked Torvalds to take a fix for a case in which thread-group synchronization (TSYNC) could hold exec_update_lock indefinitely while waiting on sibling threads. The proposed replacement is a flag that serializes those callers instead of stretching the lock across the wait. Coverage figures in the pull note were essentially unchanged.

Torvalds declined. "I'm not taking some random new core signal flag like this for some random security module. That's against the whole point of having a security layer," he wrote, and asked what makes Landlock special enough to modify the signal structure. He also called a Link tag in the commit garbage: it pointed at the same material already in the message, not at the review discussion he wanted to see.

Salaün answered that Landlock has to serialize TSYNC callers in each thread group without holding exec_update_lock across a wait that has no bound. Seccomp, he wrote, updates sibling filter state directly under the signal lock, with a credential guard against exec. Landlock siblings update their own credentials through task work, so a competing caller must restart rather than block, so it can run the winner's task work. An unused bit in the signal structure has the right lifetime and does not grow the structure; the signal lock protects the bit, not the wait. A Landlock-owned table would add storage, lookup, insertion, removal, and allocation if entries were heap-backed.

He said an earlier design discussion of set-id and capability updates is not part of this change, that he had posted a third revision for review, and that signal code now manages the bit reservation instead of Landlock setting it directly. Landlock still handles the restart. He pointed to Christian Brauner's explanation of why the code has to get off exec_update_lock, and asked whether that addressed the objection. Torvalds had not replied as of that message.