This series introduces a new KVM selftest (mem_slot_test) that goal
is to verify memory slots can be added up to the maximum allowed. An
extra slot is attempted which should occur on error.
The patch 01 is needed so that the VM fd can be accessed from the
test code (for the ioctl call attempting to add an extra slot).
I ran the test successfully on x86_64, aarch64, and s390x. This
is why it is enabled to build on those arches.
Finally, I hope it is useful test!
Wainer dos Santos Moschetta (2):
selftests: kvm: Add vm_get_fd() in kvm_util
selftests: kvm: Add mem_slot_test test
tools/testing/selftests/kvm/.gitignore | 1 +
tools/testing/selftests/kvm/Makefile | 3 +
.../testing/selftests/kvm/include/kvm_util.h | 1 +
tools/testing/selftests/kvm/lib/kvm_util.c | 5 +
tools/testing/selftests/kvm/mem_slot_test.c | 92 +++++++++++++++++++
5 files changed, 102 insertions(+)
create mode 100644 tools/testing/selftests/kvm/mem_slot_test.c
--
2.17.2
On Mon, Mar 30, 2020 at 5:19 PM Liu Yiding <liuyd.fnst(a)cn.fujitsu.com> wrote:
>
>
> On 3/30/20 2:09 PM, Andrii Nakryiko wrote:
> > On 3/29/20 5:48 PM, Liu Yiding wrote:
> >> Add attachment.
> >>
> >
> > Your BTF seems to be invalid. It has struct perf_ibs, which has a
> > first field `struct pmu pmu` field with valid-looking size of 296
> > bytes, **but** the type that field points to is not a complete `struct
> > pmu` definition, but rather just forward declaration. The way it is it
> > shouldn't be even compilable, because forward declaration of a struct
> > doesn't specify the size of a struct, so compiler should have rejected
> > it. So it must be that either DWARF generated by compiler isn't
> > correct, or there is DWARF -> BTF conversion bug somewhere. Are you
> > using any special DWARF Kconfig settings? Maybe you can share your
> > full .config and I might try to repro it on my machine.
> >
>
> >> Are you using any special DWARF Kconfig settings?
>
> Sorry, i'm a newbie at this. I don't know which settings are related to
> DWARF.
>
> Just search keywords.
>
> ```
>
> liuyd@localhost:~$ cat config-5.6.0-rc5 | grep DWARF
> # CONFIG_DEBUG_INFO_DWARF4 is not set
>
> ```
>
> I built attached config on a clear ubuntu machine. Error could be
> reproduced. So you are right, there is a conflict between kconfigs.
>
>
> >> Maybe you can share your full .config and I might try to repro it on
> my machine.
>
> Thanks a lot. I attached the broken config.
Thanks a lot! I think it's due to DEBUG_INFO_REDUCED which produces
not entirely correct DWARF. I'm asking Slava to disable this config
when BTF is requested in [0].
[0] https://lore.kernel.org/bpf/CAEf4BzadnfAwfa1D0jZb=01Ou783GpK_U7PAYeEJca-L9k…
>
>
> > But either way, that warning you get is a valid one, it should be
> > illegal to have non-pointer forward-declared struct as a type for a
> > struct member.
> >
> >>
> >> On 3/30/20 8:46 AM, Liu Yiding wrote:
> >>> Something wrong with my smtp and this email missed.
> >>>
> >>> Send again.
> >>>
> >>>
> >>> On 3/27/20 11:09 AM, Liu Yiding wrote:
> >>>> Hi, Andrii.
> >>>>
> >>>> Thanks for your prompt reply!
> >>>>
> >>>> Please check attatchment for my_btf.bin.
> >>>>
> >>>>
> >>>> On 3/27/20 4:28 AM, Andrii Nakryiko wrote:
> >>>>> Would you be able to share BTF of vmlinux that is used to generate
> >>>>> vmlinux.h? Please run in verbose mode: `make V=1` and search for
> >>>>> `bpftool btf dump file` command. It should point either to
> >>>>> /sys/kernel/btf/vmlinux or some other location, depending on how
> >>>>> things are set up on your side.
> >>>>>
> >>>>> If it's /sys/kernel/btf/vmlinux, you can just `cat
> >>>>> /sys/kernel/btf/vmlinux > my_btf.bin`. If it's some other file,
> >>>>> easiest would be to just share that file. If not, it's possible to
> >>>>> extract .BTF ELF section, let me know if you need help with that.
> >>>>
> >
> >
> >
> --
> Best Regards.
> Liu Yiding
>
>
>
This patchset contains everything needed to integrate KASAN and KUnit.
KUnit will be able to:
(1) Fail tests when an unexpected KASAN error occurs
(2) Pass tests when an expected KASAN error occurs
KASAN Tests have been converted to KUnit with the exception of
copy_user_test because KUnit is unable to test those. I am working on
documentation on how to use these new tests to be included in the next
version of this patchset.
Changes since v1:
- Make use of Alan Maguire's suggestion to use his patch that allows
static resources for integration instead of adding a new attribute to
the kunit struct
- All KUNIT_EXPECT_KASAN_FAIL statements are local to each test
- The definition of KUNIT_EXPECT_KASAN_FAIL is local to the
test_kasan.c file since it seems this is the only place this will
be used.
- Integration relies on KUnit being builtin
- copy_user_test has been separated into its own file since KUnit
is unable to test these. This can be run as a module just as before,
using CONFIG_TEST_KASAN_USER
- The addition to the current task has been separated into its own
patch as this is a significant enough change to be on its own.
Patricia Alfonso (3):
Add KUnit Struct to Current Task
KUnit: KASAN Integration
KASAN: Port KASAN Tests to KUnit
include/kunit/test.h | 10 +
include/linux/sched.h | 4 +
lib/Kconfig.kasan | 13 +-
lib/Makefile | 1 +
lib/kunit/test.c | 10 +-
lib/test_kasan.c | 639 +++++++++++++++----------------------
lib/test_kasan_copy_user.c | 75 +++++
mm/kasan/report.c | 33 ++
8 files changed, 400 insertions(+), 385 deletions(-)
create mode 100644 lib/test_kasan_copy_user.c
--
2.25.1.696.g5e7596f4ac-goog
Memory protection keys enables an application to protect its address
space from inadvertent access by its own code.
This feature is now enabled on powerpc and has been available since
4.16-rc1. The patches move the selftests to arch neutral directory
and enhance their test coverage.
Tested on powerpc64 and x86_64 (Skylake-SP).
Link to development branch:
https://github.com/sandip4n/linux/tree/pkey-selftests
Resending this based on feedback from maintainers who felt this
can go in via the -mm tree. This has no other changes from the
last version (v18) apart from being rebased.
Changelog
---------
Link to previous version (v18):
https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=155970
v19:
(1) Rebased on top of latest master.
v18:
(1) Fixed issues with x86 multilib builds based on
feedback from Dave.
(2) Moved patch 2 to the end of the series.
v17:
(1) Fixed issues with i386 builds when running on x86_64
based on feedback from Dave.
(2) Replaced patch 6 from previous version with patch 7.
This addresses u64 format specifier related concerns
that Michael had raised in v15.
v16:
(1) Rebased on top of latest master.
(2) Switched to u64 instead of using an arch-dependent
pkey_reg_t type for references to the pkey register
based on suggestions from Dave, Michal and Michael.
(3) Removed build time determination of page size based
on suggestion from Michael.
(4) Fixed comment before the definition of __page_o_noops()
from patch 13 ("selftests/vm/pkeys: Introduce powerpc
support").
v15:
(1) Rebased on top of latest master.
(2) Addressed review comments from Dave Hansen.
(3) Moved code for getting or setting pkey bits to new
helpers. These changes replace patch 7 of v14.
(4) Added a fix which ensures that the correct count of
reserved keys is used across different platforms.
(5) Added a fix which ensures that the correct page size
is used as powerpc supports both 4K and 64K pages.
v14:
(1) Incorporated another round of comments from Dave Hansen.
v13:
(1) Incorporated comments for Dave Hansen.
(2) Added one more test for correct pkey-0 behavior.
v12:
(1) Fixed the offset of pkey field in the siginfo structure for
x86_64 and powerpc. And tries to use the actual field
if the headers have it defined.
v11:
(1) Fixed a deadlock in the ptrace testcase.
v10 and prior:
(1) Moved the testcase to arch neutral directory.
(2) Split the changes into incremental patches.
Desnes A. Nunes do Rosario (1):
selftests/vm/pkeys: Fix number of reserved powerpc pkeys
Ram Pai (16):
selftests/x86/pkeys: Move selftests to arch-neutral directory
selftests/vm/pkeys: Rename all references to pkru to a generic name
selftests/vm/pkeys: Move generic definitions to header file
selftests/vm/pkeys: Fix pkey_disable_clear()
selftests/vm/pkeys: Fix assertion in pkey_disable_set/clear()
selftests/vm/pkeys: Fix alloc_random_pkey() to make it really random
selftests/vm/pkeys: Introduce generic pkey abstractions
selftests/vm/pkeys: Introduce powerpc support
selftests/vm/pkeys: Fix assertion in test_pkey_alloc_exhaust()
selftests/vm/pkeys: Improve checks to determine pkey support
selftests/vm/pkeys: Associate key on a mapped page and detect access
violation
selftests/vm/pkeys: Associate key on a mapped page and detect write
violation
selftests/vm/pkeys: Detect write violation on a mapped
access-denied-key page
selftests/vm/pkeys: Introduce a sub-page allocator
selftests/vm/pkeys: Test correct behaviour of pkey-0
selftests/vm/pkeys: Override access right definitions on powerpc
Sandipan Das (5):
selftests: vm: pkeys: Use sane types for pkey register
selftests: vm: pkeys: Add helpers for pkey bits
selftests: vm: pkeys: Use the correct huge page size
selftests: vm: pkeys: Use the correct page size on powerpc
selftests: vm: pkeys: Fix multilib builds for x86
Thiago Jung Bauermann (2):
selftests/vm/pkeys: Move some definitions to arch-specific header
selftests/vm/pkeys: Make gcc check arguments of sigsafe_printf()
tools/testing/selftests/vm/.gitignore | 1 +
tools/testing/selftests/vm/Makefile | 73 ++
tools/testing/selftests/vm/pkey-helpers.h | 225 ++++++
tools/testing/selftests/vm/pkey-powerpc.h | 136 ++++
tools/testing/selftests/vm/pkey-x86.h | 181 +++++
.../selftests/{x86 => vm}/protection_keys.c | 696 ++++++++++--------
tools/testing/selftests/x86/.gitignore | 1 -
tools/testing/selftests/x86/Makefile | 2 +-
tools/testing/selftests/x86/pkey-helpers.h | 219 ------
9 files changed, 1002 insertions(+), 532 deletions(-)
create mode 100644 tools/testing/selftests/vm/pkey-helpers.h
create mode 100644 tools/testing/selftests/vm/pkey-powerpc.h
create mode 100644 tools/testing/selftests/vm/pkey-x86.h
rename tools/testing/selftests/{x86 => vm}/protection_keys.c (74%)
delete mode 100644 tools/testing/selftests/x86/pkey-helpers.h
--
2.17.1
Hi,
This new patch series brings improvements, fix some bugs but mainly
simplify the code.
The object, rule and ruleset management are simplified at the expense of
a less aggressive memory freeing (contributed by Jann Horn [1]). There
is now less use of RCU for an improved readability. Access checks that
can be reached by file-descriptor-based syscalls are removed for now
(truncate, getattr, lock, chmod, chown, chgrp, ioctl). This will be
handle in a future evolution of Landlock, but right now the goal is to
lighten the code to ease review. The SLOC count for security/landlock/
was 1542 with the previous patch series while the current series shrinks
it to 1273.
The other main improvement is the addition of rule layer levels to
ensure that a nested sandbox cannot bypass the access restrictions set
by its parents.
The syscall is now wired for all architectures and the tests passed for
x86_32 and x86_64.
The compiled documentation is available here:
https://landlock.io/linux-doc/landlock-v15/security/landlock/index.html
This series can be applied on top of v5.6-rc7. This can be tested with
CONFIG_SECURITY_LANDLOCK and CONFIG_SAMPLE_LANDLOCK. This patch series
can be found in a Git repository here:
https://github.com/landlock-lsm/linux/commits/landlock-v15
I would really appreciate constructive comments on the design and the code.
# 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 [2], 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.
# Current limitations
## Path walk
Landlock need to use dentries to identify a file hierarchy, which is
needed for composable and unprivileged access-controls. This means that
path resolution/walking (handled with inode_permission()) is not
supported, yet. The same limitation also apply to readlink(2). This
could be filled with a future extension first of the LSM framework. The
Landlock userspace ABI can handle such change with new options (e.g. to
the struct landlock_ruleset).
## UnionFS
An UnionFS super-block use a set of upper and lower directories. Access
request to a file in one of these hierarchy trigger a call to
ovl_path_real() which generate another access request according to the
matching hierarchy. Because such super-block is not aware of its current
mount point, OverlayFS can't create a dedicated mnt_parent for each of
the upper and lower directories mount clones. It is then not currently
possible to track the source of such indirect access-request, and then
not possible to identify a unified OverlayFS hierarchy.
## Memory limits
There is currently no limit on the memory usage. Any idea to leverage
an existing mechanism (e.g. rlimit)?
# Changes since v14
* Simplify the object, rule and ruleset management at the expense of a
less aggressive memory freeing.
* Remove access checks that may be required for FD-only requests:
truncate, getattr, lock, chmod, chown, chgrp, ioctl.
* Add the notion of rule layer level to ensure that a nested sandbox
cannot bypass the access restrictions set by its parent.
* Wire up the syscall for all architectures.
* Clean up the code and add more documentation.
* Some improvements and bug fixes.
# Changes since v13
* Revamp of the LSM: remove the need for eBPF and seccomp(2).
* Implement a full filesystem access-control.
* Take care of the backward compatibility issues, especially for
security features, following a best-effort approach.
Previous version:
https://lore.kernel.org/lkml/20200224160215.4136-1-mic@digikod.net/
[1] https://lore.kernel.org/lkml/CAG48ez21bEn0wL1bbmTiiu8j9jP5iEWtHOwz4tURUJ+ki…
[2] https://lore.kernel.org/lkml/50db058a-7dde-441b-a7f9-f6837fe8b69f@schaufler…
Regards,
Mickaël Salaün (10):
landlock: Add object management
landlock: Add ruleset and domain management
landlock: Set up the security framework and manage credentials
landlock: Add ptrace restrictions
fs,landlock: Support filesystem access-control
landlock: Add syscall implementation
arch: Wire up landlock() syscall
selftests/landlock: Add initial tests
samples/landlock: Add a sandbox manager example
landlock: Add user and kernel documentation
Documentation/security/index.rst | 1 +
Documentation/security/landlock/index.rst | 18 +
Documentation/security/landlock/kernel.rst | 69 +
Documentation/security/landlock/user.rst | 227 +++
MAINTAINERS | 12 +
arch/alpha/kernel/syscalls/syscall.tbl | 1 +
arch/arm/tools/syscall.tbl | 1 +
arch/arm64/include/asm/unistd.h | 2 +-
arch/arm64/include/asm/unistd32.h | 2 +
arch/ia64/kernel/syscalls/syscall.tbl | 1 +
arch/m68k/kernel/syscalls/syscall.tbl | 1 +
arch/microblaze/kernel/syscalls/syscall.tbl | 1 +
arch/mips/kernel/syscalls/syscall_n32.tbl | 1 +
arch/mips/kernel/syscalls/syscall_n64.tbl | 1 +
arch/mips/kernel/syscalls/syscall_o32.tbl | 1 +
arch/parisc/kernel/syscalls/syscall.tbl | 1 +
arch/powerpc/kernel/syscalls/syscall.tbl | 1 +
arch/s390/kernel/syscalls/syscall.tbl | 1 +
arch/sh/kernel/syscalls/syscall.tbl | 1 +
arch/sparc/kernel/syscalls/syscall.tbl | 1 +
arch/x86/entry/syscalls/syscall_32.tbl | 1 +
arch/x86/entry/syscalls/syscall_64.tbl | 1 +
arch/xtensa/kernel/syscalls/syscall.tbl | 1 +
fs/super.c | 2 +
include/linux/fs.h | 5 +
include/linux/landlock.h | 22 +
include/linux/syscalls.h | 3 +
include/uapi/asm-generic/unistd.h | 4 +-
include/uapi/linux/landlock.h | 311 ++++
kernel/sys_ni.c | 3 +
samples/Kconfig | 7 +
samples/Makefile | 1 +
samples/landlock/.gitignore | 1 +
samples/landlock/Makefile | 15 +
samples/landlock/sandboxer.c | 217 +++
security/Kconfig | 11 +-
security/Makefile | 2 +
security/landlock/Kconfig | 18 +
security/landlock/Makefile | 4 +
security/landlock/common.h | 20 +
security/landlock/cred.c | 46 +
security/landlock/cred.h | 55 +
security/landlock/fs.c | 561 ++++++++
security/landlock/fs.h | 42 +
security/landlock/object.c | 66 +
security/landlock/object.h | 92 ++
security/landlock/ptrace.c | 120 ++
security/landlock/ptrace.h | 14 +
security/landlock/ruleset.c | 352 +++++
security/landlock/ruleset.h | 182 +++
security/landlock/setup.c | 39 +
security/landlock/setup.h | 18 +
security/landlock/syscall.c | 521 +++++++
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/landlock/.gitignore | 4 +
tools/testing/selftests/landlock/Makefile | 26 +
tools/testing/selftests/landlock/common.h | 42 +
tools/testing/selftests/landlock/config | 5 +
tools/testing/selftests/landlock/test_base.c | 113 ++
tools/testing/selftests/landlock/test_fs.c | 1249 +++++++++++++++++
.../testing/selftests/landlock/test_ptrace.c | 294 ++++
tools/testing/selftests/landlock/true.c | 5 +
62 files changed, 4833 insertions(+), 7 deletions(-)
create mode 100644 Documentation/security/landlock/index.rst
create mode 100644 Documentation/security/landlock/kernel.rst
create mode 100644 Documentation/security/landlock/user.rst
create mode 100644 include/linux/landlock.h
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/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/syscall.c
create mode 100644 tools/testing/selftests/landlock/.gitignore
create mode 100644 tools/testing/selftests/landlock/Makefile
create mode 100644 tools/testing/selftests/landlock/common.h
create mode 100644 tools/testing/selftests/landlock/config
create mode 100644 tools/testing/selftests/landlock/test_base.c
create mode 100644 tools/testing/selftests/landlock/test_fs.c
create mode 100644 tools/testing/selftests/landlock/test_ptrace.c
create mode 100644 tools/testing/selftests/landlock/true.c
--
2.26.0.rc2
Hi,
This new version of Landlock is a major revamp of the previous series
[1], hence the RFC tag. The three main changes are the replacement of
eBPF with a dedicated safe management of access rules, the replacement
of the use of seccomp(2) with a dedicated syscall, and the management of
filesystem access-control (back from the v10).
As discussed in [2], eBPF may be too powerful and dangerous to be put in
the hand of unprivileged and potentially malicious processes, especially
because of side-channel attacks against access-controls or other parts
of the kernel.
Thanks to this new implementation (1540 SLOC), designed from the ground
to be used by unprivileged processes, this series enables a process to
sandbox itself without requiring CAP_SYS_ADMIN, but only the
no_new_privs constraint (like seccomp). Not relying on eBPF also
enables to improve performances, especially for stacked security
policies thanks to mergeable rulesets.
The compiled documentation is available here:
https://landlock.io/linux-doc/landlock-v14/security/landlock/index.html
This series can be applied on top of v5.6-rc3. This can be tested with
CONFIG_SECURITY_LANDLOCK and CONFIG_SAMPLE_LANDLOCK. This patch series
can be found in a Git repository here:
https://github.com/landlock-lsm/linux/commits/landlock-v14
I would really appreciate constructive comments on the design and the code.
# 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 [3], 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 empower 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.
# Current limitations
## Path walk
Landlock need to use dentries to identify a file hierarchy, which is
needed for composable and unprivileged access-controls. This means that
path resolution/walking (handled with inode_permission()) is not
supported, yet. This could be filled with a future extension first of
the LSM framework. The Landlock userspace ABI can handle such change
with new option (e.g. to the struct landlock_ruleset).
## UnionFS
An UnionFS super-block use a set of upper and lower directories. An
access request to a file in one of these hierarchy trigger a call to
ovl_path_real() which generate another access request according to the
matching hierarchy. Because such super-block is not aware of its current
mount point, OverlayFS can't create a dedicated mnt_parent for each of
the upper and lower directories mount clones. It is then not currently
possible to track the source of such indirect access-request, and then
not possible to identify a unified OverlayFS hierarchy.
## Syscall
Because it is only tested on x86_64, the syscall is only wired up for
this architecture. The whole x86 family (and probably all the others)
will be supported in the next patch series.
## Memory limits
There is currently no limit on the memory usage. Any idea to leverage
an existing mechanism (e.g. rlimit)?
# Changes since v13
* Revamp of the LSM: remove the need for eBPF and seccomp(2).
* Implement a full filesystem access-control.
* Take care of the backward compatibility issues, especially for
this security features.
Previous version:
https://lore.kernel.org/lkml/20191104172146.30797-1-mic@digikod.net/
[1] https://lore.kernel.org/lkml/20191104172146.30797-1-mic@digikod.net/
[2] https://lore.kernel.org/lkml/a6b61f33-82dc-0c1c-7a6c-1926343ef63e@digikod.n…
[3] https://lore.kernel.org/lkml/50db058a-7dde-441b-a7f9-f6837fe8b69f@schaufler…
Regards,
Mickaël Salaün (10):
landlock: Add object and rule management
landlock: Add ruleset and domain management
landlock: Set up the security framework and manage credentials
landlock: Add ptrace restrictions
fs,landlock: Support filesystem access-control
landlock: Add syscall implementation
arch: Wire up landlock() syscall
selftests/landlock: Add initial tests
samples/landlock: Add a sandbox manager example
landlock: Add user and kernel documentation
Documentation/security/index.rst | 1 +
Documentation/security/landlock/index.rst | 18 +
Documentation/security/landlock/kernel.rst | 44 ++
Documentation/security/landlock/user.rst | 233 +++++++
MAINTAINERS | 12 +
arch/x86/entry/syscalls/syscall_64.tbl | 1 +
fs/super.c | 2 +
include/linux/landlock.h | 22 +
include/linux/syscalls.h | 3 +
include/uapi/asm-generic/unistd.h | 4 +-
include/uapi/linux/landlock.h | 315 +++++++++
samples/Kconfig | 7 +
samples/Makefile | 1 +
samples/landlock/.gitignore | 1 +
samples/landlock/Makefile | 15 +
samples/landlock/sandboxer.c | 226 +++++++
security/Kconfig | 11 +-
security/Makefile | 2 +
security/landlock/Kconfig | 16 +
security/landlock/Makefile | 4 +
security/landlock/cred.c | 47 ++
security/landlock/cred.h | 55 ++
security/landlock/fs.c | 591 +++++++++++++++++
security/landlock/fs.h | 42 ++
security/landlock/object.c | 341 ++++++++++
security/landlock/object.h | 134 ++++
security/landlock/ptrace.c | 118 ++++
security/landlock/ptrace.h | 14 +
security/landlock/ruleset.c | 463 +++++++++++++
security/landlock/ruleset.h | 106 +++
security/landlock/setup.c | 38 ++
security/landlock/setup.h | 20 +
security/landlock/syscall.c | 470 +++++++++++++
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/landlock/.gitignore | 3 +
tools/testing/selftests/landlock/Makefile | 13 +
tools/testing/selftests/landlock/config | 4 +
tools/testing/selftests/landlock/test.h | 40 ++
tools/testing/selftests/landlock/test_base.c | 80 +++
tools/testing/selftests/landlock/test_fs.c | 624 ++++++++++++++++++
.../testing/selftests/landlock/test_ptrace.c | 293 ++++++++
41 files changed, 4429 insertions(+), 6 deletions(-)
create mode 100644 Documentation/security/landlock/index.rst
create mode 100644 Documentation/security/landlock/kernel.rst
create mode 100644 Documentation/security/landlock/user.rst
create mode 100644 include/linux/landlock.h
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/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/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/syscall.c
create mode 100644 tools/testing/selftests/landlock/.gitignore
create mode 100644 tools/testing/selftests/landlock/Makefile
create mode 100644 tools/testing/selftests/landlock/config
create mode 100644 tools/testing/selftests/landlock/test.h
create mode 100644 tools/testing/selftests/landlock/test_base.c
create mode 100644 tools/testing/selftests/landlock/test_fs.c
create mode 100644 tools/testing/selftests/landlock/test_ptrace.c
--
2.25.0