Landlock fixes for v7.4-rc4
Hi,
This fixes several Landlock and LSM issues:
- prevent composed rulesets from denying link and rename operations that each ruleset allows separately;
- close capability-mediation gaps for low-address mappings, inheritable capabilities, the admin memory reserve, and PR_SET_SECUREBITS, so LSM capability denials apply consistently;
- distinguish namespace creation from entry in denial records and expose the checked capability context to BPF tracepoint consumers, so they can interpret denials correctly.
Tests and documentation are updated. This also fixes clang-format's handling of guard() and a missing landlock_add_rule(2) error description.
Please pull these changes for v7.4-rc4 . These commits merge cleanly with your master branch. Kernel changes have been tested in the latest linux-next releases.
Test coverage for security/landlock is 91.8% of 2894 lines according to LLVM 23, and it was 91.8% of 2864 lines before this PR.
Regards,
Mickaël
--
The following changes since commit aebb7274476403040d582c61478df8f4a7bf9cd3:
Linux 7.4-rc3 (2026-11-15 14:30:11 -0800)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/mic/linux.git tags/landlock-7.4-rc4
for you to fetch changes up to 4feb6879b9ab42cacb905f27a44160b7f1f49d85:
landlock: Add missing EINVAL case in the doc for landlock_add_rule (2026-11-19 17:51:43 +0100)
----------------------------------------------------------------
Landlock fixes for v7.4-rc4
----------------------------------------------------------------
Günther Noack (5):
landlock: Fix layer composition of LANDLOCK_ACCESS_FS_REFER
landlock: Add KUnit test for landlock_get_fs_access_mask() selftests/landlock: Test that layering does not break refer
landlock: Simplify landlock_get_fs_access_mask()
landlock: Clarify implicit handling of LANDLOCK_ACCESS_FS_REFER
Mickaël Salaün (13):
landlock: Factor out capability denial checks
landlock: Mediate CAP_SYS_RAWIO for mappings below mmap_min_addr
landlock: Mediate CAP_SETPCAP for inheritable capabilities
landlock: Mediate CAP_SYS_ADMIN for the admin memory reserve selftests/landlock: Test capability checks outside the capable hook
landlock: Fix capability restriction documentation
capabilities: Check PR_SET_SECUREBITS with ns_capable() selftests/landlock: Test PR_SET_SECUREBITS mediation
landlock: Distinguish namespace creation and entry denials
landlock: Add capability objects to denial tracing selftests/landlock: Test namespace denial operations
landlock: Document namespace denial operations
clang-format: Fix formatting of guard()
Tingmao Wang (1):
landlock: Add missing EINVAL case in the doc for landlock_add_rule
.clang-format | 1 - Documentation/admin-guide/LSM/landlock.rst | 21 +- Documentation/security/landlock.rst | 8 +- Documentation/trace/events-landlock.rst | 26 +- Documentation/userspace-api/landlock.rst | 11 +- include/trace/events/landlock.h | 36 ++- include/uapi/linux/landlock.h | 24 +- security/commoncap.c | 45 ++-- security/landlock/access.h | 11 +- security/landlock/audit.c | 10 +- security/landlock/cap.c | 130 ++++++++- security/landlock/domain.c | 44 +++ security/landlock/domain.h | 9 +- security/landlock/errata/abi-4.h | 21 ++ security/landlock/log.c | 6 +- security/landlock/log.h | 12 +- security/landlock/ns.c | 10 +- security/landlock/syscalls.c | 1 + security/landlock/trace.c | 12 +- tools/testing/selftests/landlock/cap_test.c | 397 ++++++++++++++++++++++++++++ tools/testing/selftests/landlock/common.h | 4 +- tools/testing/selftests/landlock/fs_test.c | 61 ++++- tools/testing/selftests/landlock/ns_test.c | 25 +- tools/testing/selftests/landlock/trace.h | 1 + 24 files changed, 815 insertions(+), 111 deletions(-)
The pull request you sent on Sat, 21 Nov 2026 20:54:04 +0100:
The pull request you sent on Sat, 21 Nov 2026 20:54:04 +0100:
Quoted 1 line
https://git.kernel.org/pub/scm/linux/kernel/git/mic/linux.git tags/landlock-7.4-rc4
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/eef2bc5a82c25d25c3082f5d86d97a300caeb678
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html