[PR #6125] [MERGED] landlock: move commands into profile and add landlock.enforce #5836

Closed
opened 2026-05-05 10:45:48 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/6125
Author: @kmk3
Created: 12/11/2023
Status: Merged
Merged: 12/21/2023
Merged by: @netblue30

Base: masterHead: landlock-enforce


📝 Commits (4)

  • 19e1082 landlock: expand simple macros in commands
  • f0dc85e landlock: sort --landlock commands
  • 5679d10 landlock: avoid landlock syscalls before ll_restrict
  • 760f50f landlock: move commands into profile and add landlock.enforce

📊 Changes

15 files changed (+91 additions, -153 deletions)

View changed files

📝 contrib/syntax/lists/profile_commands_arg0.list (+1 -1)
📝 contrib/syntax/lists/profile_commands_arg1.list (+0 -1)
etc/inc/landlock-common.inc (+39 -0)
📝 etc/profile-a-l/default.profile (+2 -0)
📝 etc/templates/profile.template (+7 -0)
📝 src/bash_completion/firejail.bash_completion.in (+1 -1)
📝 src/firejail/firejail.h (+1 -3)
📝 src/firejail/landlock.c (+12 -57)
📝 src/firejail/main.c (+3 -17)
📝 src/firejail/profile.c (+3 -18)
📝 src/firejail/sandbox.c (+4 -11)
📝 src/firejail/usage.c (+1 -2)
📝 src/man/firejail-profile.5.in (+4 -11)
📝 src/man/firejail.1.in (+12 -29)
📝 src/zsh_completion/_firejail.in (+1 -2)

📄 Description

Changes:

  • Move commands from --landlock and --landlock.proc= into
    etc/inc/landlock-common.inc
  • Remove --landlock and --landlock.proc=
  • Add --landlock.enforce

Instead of hard-coding the default commands (and having a separate
command just for /proc), move them into a dedicated profile to make it
easier for users to interact with the entries (view, copy, add ignore
entries, etc).

Only enforce the Landlock commands if --landlock.enforce is supplied.
This allows safely adding Landlock commands to (upstream) profiles while
keeping their enforcement opt-in. It also makes it simpler to
effectively disable all Landlock commands, by using
--ignore=landlock.enforce.

Relates to #6078.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/6125 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 12/11/2023 **Status:** ✅ Merged **Merged:** 12/21/2023 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `landlock-enforce` --- ### 📝 Commits (4) - [`19e1082`](https://github.com/netblue30/firejail/commit/19e108248c88605b5470f2e5018f40a74b20a28e) landlock: expand simple macros in commands - [`f0dc85e`](https://github.com/netblue30/firejail/commit/f0dc85e60e495511bbeba521edc8749d3e81dc38) landlock: sort --landlock commands - [`5679d10`](https://github.com/netblue30/firejail/commit/5679d1028b337afb8b1c22f40b5bc595161b8950) landlock: avoid landlock syscalls before ll_restrict - [`760f50f`](https://github.com/netblue30/firejail/commit/760f50f78ad13664d7a32b4577381c0341ab2d4a) landlock: move commands into profile and add landlock.enforce ### 📊 Changes **15 files changed** (+91 additions, -153 deletions) <details> <summary>View changed files</summary> 📝 `contrib/syntax/lists/profile_commands_arg0.list` (+1 -1) 📝 `contrib/syntax/lists/profile_commands_arg1.list` (+0 -1) ➕ `etc/inc/landlock-common.inc` (+39 -0) 📝 `etc/profile-a-l/default.profile` (+2 -0) 📝 `etc/templates/profile.template` (+7 -0) 📝 `src/bash_completion/firejail.bash_completion.in` (+1 -1) 📝 `src/firejail/firejail.h` (+1 -3) 📝 `src/firejail/landlock.c` (+12 -57) 📝 `src/firejail/main.c` (+3 -17) 📝 `src/firejail/profile.c` (+3 -18) 📝 `src/firejail/sandbox.c` (+4 -11) 📝 `src/firejail/usage.c` (+1 -2) 📝 `src/man/firejail-profile.5.in` (+4 -11) 📝 `src/man/firejail.1.in` (+12 -29) 📝 `src/zsh_completion/_firejail.in` (+1 -2) </details> ### 📄 Description Changes: * Move commands from --landlock and --landlock.proc= into etc/inc/landlock-common.inc * Remove --landlock and --landlock.proc= * Add --landlock.enforce Instead of hard-coding the default commands (and having a separate command just for /proc), move them into a dedicated profile to make it easier for users to interact with the entries (view, copy, add ignore entries, etc). Only enforce the Landlock commands if --landlock.enforce is supplied. This allows safely adding Landlock commands to (upstream) profiles while keeping their enforcement opt-in. It also makes it simpler to effectively disable all Landlock commands, by using `--ignore=landlock.enforce`. Relates to #6078. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:45:48 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#5836
No description provided.