Landlock LSM
Status from this message: Applied to git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v34 Latest13 patches 3 repliesApplied
- v3312 patches 3 repliesSuperseded
- v3212 patches 0 repliesSuperseded
Earlier versions · 21
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v31 | 12 patches | 7 replies | Superseded | |
| v30 | 12 patches | 36 replies | Superseded | |
| v29 | 12 patches | 0 replies | Superseded | |
| v28 | 12 patches | 15 replies | Superseded | |
| v27 | 12 patches | 4 replies | Superseded | |
| v26 | 12 patches | 12 replies | Superseded | |
| v25 | 12 patches | 0 replies | Superseded | |
| v24 | 12 patches | 14 replies | Superseded | |
| v23 | 12 patches | 2 replies | Superseded | |
| v22 | 12 patches | 24 replies | Superseded | |
| v21 | 12 patches | 5 replies | Superseded | |
| v20 | 12 patches | 6 replies | Superseded | |
| v19 | 12 patches | 14 replies | Superseded | |
| v18 | 12 patches | 2 replies | Superseded | |
| v17 | 10 patches | 10 replies | Superseded | |
| v16 | 10 patches | 0 replies | Superseded | |
| v15 | 10 patches | 5 replies | Superseded | |
| v14 RFC | 10 patches | 25 replies | Superseded | |
| v13 | 7 patches | 18 replies | Superseded | |
| v12 | 7 patches | 0 replies | Superseded | |
| v11 | 7 patches | 2 replies | Superseded |
Patches in v34 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | landlock: Add object managementMAINTAINERS security/ security/ +4 more | +195 | 0 replies | |
| 2/13 | landlock: Add ruleset and domain managementsecurity/ security/ security/ +1 more | +652 | 0 replies | |
| 3/13 | landlock: Set up the security framework and manage credentialssecurity/ security/ security/ +4 more | +178 | 0 replies | |
| 4/13 | landlock: Add ptrace restrictionssecurity/ security/ security/ +1 more | +137 | 0 replies | |
| 5/13 | LSM: Infrastructure management of the superblockinclude/ security/ security/ +4 more | +85 | 0 replies | |
| 6/13 | fs,security: Add sb_delete hookfs/ include/ include/ +2 more | +14 | 0 replies | |
| 7/13 | landlock: Support filesystem access-controlMAINTAINERS arch/ arch/ +9 more | +866 | 0 replies | |
| 8/13 | landlock: Add syscall implementationsinclude/ include/ kernel/ +2 more | +508 | 1 reply | |
| 9/13 | arch: Wire up Landlock syscallsarch/ arch/ arch/ +16 more | +62 | 0 replies | |
| 10/13 | selftests/landlock: Add user space testsMAINTAINERS tools/ tools/ +7 more | +3570 | 0 replies | |
| 11/13 | samples/landlock: Add a sandbox manager exampleMAINTAINERS samples/ samples/ +3 more | +261 | 0 replies | |
| 12/13 | landlock: Add user and kernel documentationDocumentation/ Documentation/ Documentation/ +2 more | +400 | 0 replies | |
| 13/13 | landlock: Enable user space to infer supported featuresinclude/ security/ tools/ | +68 | 0 replies |
Reviews trailers per patch
10 of 13 patches have a Reviewed-by or Acked-by.
| Patch | Jann Horn | Serge Hallyn | Kees Cook | Stephen Smalley | Vincent Dagonneau |
|---|---|---|---|---|---|
| 1/13 | R-b | A-b | R-b | ||
| 2/13 | R-b | A-b | R-b | ||
| 3/13 | R-b | A-b | R-b | ||
| 4/13 | R-b | A-b | R-b | ||
| 5/13 | A-b | R-b | R-b | ||
| 6/13 | R-b | A-b | R-b | ||
| 7/13 | |||||
| 8/13 | A-b | ||||
| 9/13 | |||||
| 10/13 | R-b | R-b | |||
| 11/13 | R-b | R-b | |||
| 12/13 | R-b | R-b | |||
| 13/13 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.
Cover letter [PATCH v34 00/13] Landlock LSM
Hi,
This updated patch series adds a new patch on top of the previous ones. It brings a new flag to landlock_create_ruleset(2) that enables efficient and simple backward compatibility checks for future evolutions of Landlock (e.g. new access-control rights). Indeed, it is important to help user space to follow a best-effort security. This new flag is not strictly useful for applications using the current Landlock features but it will be useful when applications developed for newer kernels will be run on older kernels (e.g. the current one).
Here is an example of a (work in progress) library using this information to provide a nice backward compatible API:
https://github.com/landlock-lsm/rust-landlock
The SLOC count is 1331 for security/landlock/ and 2626 for tools/testing/selftest/landlock/ .
Test coverage for security/landlock/ is 93.6% of lines:
https://landlock.io/linux-lcov/landlock-v34/security/landlock/index.html
The code not covered only deals with internal kernel errors (e.g. memory allocation), race conditions and safety checks that should not be triggered. This series is being fuzzed by syzkaller (covering internal kernel errors) that now supports Landlock:
https://github.com/google/syzkaller/pull/2380
syzkaller coverage reached 72% (ci-upstream-linux-next-kasan-gce-root):
https://syzkaller.appspot.com/upstream
The HTML documentation is available here:
https://landlock.io/linux-doc/landlock-v34/userspace-api/landlock.html
This series can be applied on top of v5.12-rc3 . This can be tested with CONFIG_SECURITY_LANDLOCK, CONFIG_SAMPLE_LANDLOCK and by prepending "landlock," to CONFIG_LSM. This patch series can be found in a Git repository here:
https://github.com/landlock-lsm/linux/commits/landlock-v34
This patch series seems ready for upstream and I would really appreciate final reviews.
Landlock LSM
============
The goal of Landlock is to enable to restrict ambient rights (e.g. global filesystem access) for a set of processes. Because Landlock is a stackable LSM [1], it makes possible to create safe security sandboxes as new security layers in addition to the existing system-wide access-controls. This kind of sandbox is expected to help mitigate the security impact of bugs or unexpected/malicious behaviors in user-space applications. Landlock empowers any process, including unprivileged ones, to securely restrict themselves.
Landlock is inspired by seccomp-bpf but instead of filtering syscalls and their raw arguments, a Landlock rule can restrict the use of kernel objects like file hierarchies, according to the kernel semantic. Landlock also takes inspiration from other OS sandbox mechanisms: XNU Sandbox, FreeBSD Capsicum or OpenBSD Pledge/Unveil.
In this current form, Landlock misses some access-control features. This enables to minimize this patch series and ease review. This series still addresses multiple use cases, especially with the combined use of
seccomp-bpf: applications with built-in sandboxing, init systems, security sandbox tools and security-oriented APIs [2].
[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/
Previous versions:
v33: https://lore.kernel.org/lkml/[email protected]/
v32: https://lore.kernel.org/lkml/[email protected]/
v31: https://lore.kernel.org/lkml/[email protected]/
v30: https://lore.kernel.org/lkml/[email protected]/
v29: https://lore.kernel.org/lkml/[email protected]/
v28: https://lore.kernel.org/lkml/[email protected]/
v27: https://lore.kernel.org/lkml/[email protected]/
v26: https://lore.kernel.org/lkml/[email protected]/
v25: https://lore.kernel.org/lkml/[email protected]/
v24: https://lore.kernel.org/lkml/[email protected]/
v23: https://lore.kernel.org/lkml/[email protected]/
v22: https://lore.kernel.org/lkml/[email protected]/
v21: https://lore.kernel.org/lkml/[email protected]/
v20: https://lore.kernel.org/lkml/[email protected]/
v19: https://lore.kernel.org/lkml/[email protected]/
v18: https://lore.kernel.org/lkml/[email protected]/
v17: https://lore.kernel.org/lkml/[email protected]/
v16: https://lore.kernel.org/lkml/[email protected]/
v15: https://lore.kernel.org/lkml/[email protected]/
v14: https://lore.kernel.org/lkml/[email protected]/
v13: https://lore.kernel.org/lkml/[email protected]/
v12: https://lore.kernel.org/lkml/[email protected]/
v11: https://lore.kernel.org/lkml/[email protected]/
v10: https://lore.kernel.org/lkml/[email protected]/
v9: https://lore.kernel.org/lkml/[email protected]/
v8: https://lore.kernel.org/lkml/[email protected]/
v7: https://lore.kernel.org/lkml/[email protected]/
v6: https://lore.kernel.org/lkml/[email protected]/
v5: https://lore.kernel.org/lkml/[email protected]/
v4: https://lore.kernel.org/lkml/[email protected]/
v3: https://lore.kernel.org/lkml/[email protected]/
v2: https://lore.kernel.org/lkml/[email protected]/
v1: https://lore.kernel.org/kernel-hardening/[email protected]/
Casey Schaufler (1):
LSM: Infrastructure management of the superblock
Mickaël Salaün (12):
landlock: Add object management
landlock: Add ruleset and domain management
landlock: Set up the security framework and manage credentials
landlock: Add ptrace restrictions
fs,security: Add sb_delete hook
landlock: Support filesystem access-control
landlock: Add syscall implementations
arch: Wire up Landlock syscalls
selftests/landlock: Add user space tests samples/landlock: Add a sandbox manager example
landlock: Add user and kernel documentation
landlock: Enable user space to infer supported features
Documentation/security/index.rst | 1 + Documentation/security/landlock.rst | 85 + Documentation/userspace-api/index.rst | 1 + Documentation/userspace-api/landlock.rst | 311 ++ MAINTAINERS | 15 + arch/Kconfig | 7 + arch/alpha/kernel/syscalls/syscall.tbl | 3 + arch/arm/tools/syscall.tbl | 3 + arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 6 + arch/ia64/kernel/syscalls/syscall.tbl | 3 + arch/m68k/kernel/syscalls/syscall.tbl | 3 + arch/microblaze/kernel/syscalls/syscall.tbl | 3 + arch/mips/kernel/syscalls/syscall_n32.tbl | 3 + arch/mips/kernel/syscalls/syscall_n64.tbl | 3 + arch/mips/kernel/syscalls/syscall_o32.tbl | 3 + arch/parisc/kernel/syscalls/syscall.tbl | 3 + arch/powerpc/kernel/syscalls/syscall.tbl | 3 + arch/s390/kernel/syscalls/syscall.tbl | 3 + arch/sh/kernel/syscalls/syscall.tbl | 3 + arch/sparc/kernel/syscalls/syscall.tbl | 3 + arch/um/Kconfig | 1 + arch/x86/entry/syscalls/syscall_32.tbl | 3 + arch/x86/entry/syscalls/syscall_64.tbl | 3 + arch/xtensa/kernel/syscalls/syscall.tbl | 3 + fs/super.c | 1 + include/linux/lsm_hook_defs.h | 1 + include/linux/lsm_hooks.h | 4 + include/linux/security.h | 4 + include/linux/syscalls.h | 7 + include/uapi/asm-generic/unistd.h | 8 +- include/uapi/linux/landlock.h | 137 + kernel/sys_ni.c | 5 + samples/Kconfig | 7 + samples/Makefile | 1 + samples/landlock/.gitignore | 1 + samples/landlock/Makefile | 13 + samples/landlock/sandboxer.c | 238 ++ security/Kconfig | 11 +- security/Makefile | 2 + security/landlock/Kconfig | 21 + security/landlock/Makefile | 4 + security/landlock/common.h | 20 + security/landlock/cred.c | 46 + security/landlock/cred.h | 58 + security/landlock/fs.c | 692 ++++ security/landlock/fs.h | 70 + security/landlock/limits.h | 21 + security/landlock/object.c | 67 + security/landlock/object.h | 91 + security/landlock/ptrace.c | 120 + security/landlock/ptrace.h | 14 + security/landlock/ruleset.c | 473 +++ security/landlock/ruleset.h | 165 + security/landlock/setup.c | 40 + security/landlock/setup.h | 18 + security/landlock/syscalls.c | 451 +++ security/security.c | 51 +- security/selinux/hooks.c | 58 +- security/selinux/include/objsec.h | 6 + security/selinux/ss/services.c | 3 +- security/smack/smack.h | 6 + security/smack/smack_lsm.c | 35 +- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/landlock/.gitignore | 2 + tools/testing/selftests/landlock/Makefile | 24 + tools/testing/selftests/landlock/base_test.c | 266 ++ tools/testing/selftests/landlock/common.h | 183 ++ tools/testing/selftests/landlock/config | 7 + tools/testing/selftests/landlock/fs_test.c | 2791 +++++++++++++++++ .../testing/selftests/landlock/ptrace_test.c | 337 ++ tools/testing/selftests/landlock/true.c | 5 + 72 files changed, 6986 insertions(+), 77 deletions(-) create mode 100644 Documentation/security/landlock.rst create mode 100644 Documentation/userspace-api/landlock.rst create mode 100644 include/uapi/linux/landlock.h create mode 100644 samples/landlock/.gitignore create mode 100644 samples/landlock/Makefile create mode 100644 samples/landlock/sandboxer.c create mode 100644 security/landlock/Kconfig create mode 100644 security/landlock/Makefile create mode 100644 security/landlock/common.h create mode 100644 security/landlock/cred.c create mode 100644 security/landlock/cred.h create mode 100644 security/landlock/fs.c create mode 100644 security/landlock/fs.h create mode 100644 security/landlock/limits.h create mode 100644 security/landlock/object.c create mode 100644 security/landlock/object.h create mode 100644 security/landlock/ptrace.c create mode 100644 security/landlock/ptrace.h create mode 100644 security/landlock/ruleset.c create mode 100644 security/landlock/ruleset.h create mode 100644 security/landlock/setup.c create mode 100644 security/landlock/setup.h create mode 100644 security/landlock/syscalls.c create mode 100644 tools/testing/selftests/landlock/.gitignore create mode 100644 tools/testing/selftests/landlock/Makefile create mode 100644 tools/testing/selftests/landlock/base_test.c create mode 100644 tools/testing/selftests/landlock/common.h create mode 100644 tools/testing/selftests/landlock/config create mode 100644 tools/testing/selftests/landlock/fs_test.c create mode 100644 tools/testing/selftests/landlock/ptrace_test.c create mode 100644 tools/testing/selftests/landlock/true.c
base-commit: 1e28eed17697bcf343c6743f0028cc3b5dd88bf0
Signature · 1 line
2.31.1