Latest

Cybersecurity

Torvalds rejects the Landlock patch and sparks a debate in Linux

Linus Torvalds rejects a new flag in signal_struct for Landlock and demands explanations; the maintainer defends the patch's technical design.

Translated from Spanish by an automated system. The Spanish original prevails. Read the Spanish original

Rain of green characters on a black background, terminal style
Image: Unsplash

A kernel security module wants to reserve a bit in a central structure to solve a deadlock, and Linus Torvalds has said no. The Landlock pull request for Linux 7.4-rc6 arrived on December 3 with a fix for a case in which thread synchronization could hold a lock for an indefinite time. The proposed solution added a per-process flag in `signal_struct`, and the kernel founder responded with a "No" followed by a question about what makes Landlock special.

The discussion, public on the kernel mailing list, shows two ways of understanding design. Torvalds argues that the kernel's shared structures are not modified for the convenience of a specific security module, because that dilutes the boundary that justifies having a security layer at all. Mickaël Salaün, Landlock's maintainer, maintains that the bit is the lowest-cost option and that a dedicated alternative adds storage, lookup and dynamic allocation.

For anyone who does not follow the kernel day to day, the episode may look like a plumbing argument. It matters because it decides how thread deadlocks are resolved when a process changes its credentials, and because it sets the tone of a relationship that has been strained for years by the pace of security patches. The thread was still open on December 4, with Salaün's technical reply on the table and no response from Torvalds.

What did the Landlock patch ask for?

The original problem is a path in which thread group synchronization, known as TSYNC, could hold `exec_update_lock` while waiting for sibling threads. That lock protects credential updates during an `exec`, and holding it while waiting for another thread opens the door to an unbounded deadlock. Salaün's fix replaces that wait with a flag that serializes callers.

Landlock is a module that allows a process to limit its own permissions on the file system, and one of its operations updates the credentials of all threads in the group. So that two concurrent calls do not step on each other, the maintainer needs a synchronization point with the right lifetime, and he found one in a free bit of `signal_struct`, the structure shared by a process's threads.

That bit does not enlarge the structure and is protected by the signal lock that already exists. Salaün's argument is that any dedicated alternative would have to manage a per-process table, with its storage, lookup, insertion and release, and that this cost appears on a path that runs on every `exec`. The comparison with seccomp, which updates the state of thread filters under the signal lock, completes the reasoning.

Torvalds's response

The refusal came the same day, December 3, and was brief. "I'm not going to accept a new core flag like this for any random security module. That goes against the whole point of having a security layer," he wrote in Torvalds's response to the Landlock pull request. He then asked what makes Landlock special and why it needs its own flags in the signal structure.

The message included a second, more down-to-earth complaint. Torvalds noted that the commit carried a `Link:` tag pointing to the same information already present in the message and not to the review discussion that originated it, and he called it garbage. For a maintainer who reviews hundreds of patches, that tag is the way to reconstruct why a decision was made.

The response has a process reading and a principle reading. The process one is that the patch arrived without the traceability Torvalds demands. The principle one is that a security layer should not be able to change central structures to solve its own problems, because modularity is what allows it to be enabled or disabled without touching the rest of the system.

Salaün's technical argument

The maintainer's reply came on December 4 with a new revision and a step-by-step explanation. He recalled that seccomp updates the state of sibling threads' filters under the signal lock, with a credential guard against `exec`, and that Landlock does something different: siblings update their credentials via task work, so a competing caller must restart instead of blocking.

Hence the need for the bit. A candidate that arrives while another is in progress cannot wait, because waiting is exactly what the patch wants to avoid, and it has to retry when the winner finishes. The reserved bit in `signal_struct` marks that state with the same lifetime as the thread group, and the signal lock protects the bit, not the wait.

Salaün also responded to the criticism of the tag. The `Link:` pointed to the patch and not to the discussion, and the explanation of why one must exit `exec_update_lock` was in Christian Brauner's reply. He closed by asking whether that resolved the objection, and left the argument in his December 4 reply, and the answer had not arrived by the close of this piece.

Point Landlock Dedicated alternative
Per-process state A free bit in `signal_struct` Table managed by the module
Protection Existing signal lock Its own lock
Cost on `exec` Reserving and releasing the bit Lookup, insertion and release
Structure size No changes Additional structure

Why does it matter beyond Landlock?

The discussion is not about a bit. It is about who can touch the structures shared by all processes, and what arguments are needed to justify it. In recent years, security modules have grown in scope, from application confinement to file access control, and each one needs anchor points in the kernel. Torvalds's question is reasonable: if every module asks for its flag, the central structure ends up full of exceptions.

At the same time, the refusal has a cost. Landlock carries a deadlock problem that the patch solved, and the alternative of a dedicated table adds code and error paths. The maintainer will have to choose between rewriting the approach or leaving the fix on hold, and neither option is free for users who rely on the module.

The episode also recalls that kernel review is a human bottleneck. Torvalds reads a fraction of the patches that arrive, and when he intervenes he does so with a design criterion, not with line-by-line review. The discussions he generates usually end in a better patch, even if the path goes through a public rejection.

What's next for 7.4?

The 7.4 window is still open and the Landlock pull request was left out of rc6. The question is whether Salaün finds a way to resolve the synchronization without touching `signal_struct`, or whether Torvalds accepts the argument in a later revision. The thread was not closed, and in the kernel that means the conversation can resume at any moment.

Meanwhile, 7.4 moves forward with other boot changes we have already covered, such as the direct EFI boot that systemd welcomes. The lesson of the rejection is simple and unromantic: in the kernel, security is negotiated with cost and with traceability, and an apparently free bit always has an owner asking what it is for.

José Maldonado

Author

José Maldonado

Activist and blogger on technology, free software and blockchain.

The latest
systemd 263 changes Thunderbolt security on Linux

Keep reading