selftests/landlock: Add user space tests
authorMickaël Salaün <mic@linux.microsoft.com>
Thu, 22 Apr 2021 15:41:20 +0000 (17:41 +0200)
committerJames Morris <jamorris@linux.microsoft.com>
Thu, 22 Apr 2021 19:22:11 +0000 (12:22 -0700)
commite1199815b47be83346c03e20a3de76f934e4bb34
treee71d6716f8d7d3aa57a7f179e931276bc5027524
parent265885daf3e5082eb9f6e2a23bdbf9ba4456a21b
selftests/landlock: Add user space tests

Test all Landlock system calls, ptrace hooks semantic and filesystem
access-control with multiple layouts.

Test coverage for security/landlock/ is 93.6% of lines.  The code not
covered only deals with internal kernel errors (e.g. memory allocation)
and race conditions.

Cc: James Morris <jmorris@namei.org>
Cc: Jann Horn <jannh@google.com>
Cc: Serge E. Hallyn <serge@hallyn.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Reviewed-by: Vincent Dagonneau <vincent.dagonneau@ssi.gouv.fr>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210422154123.13086-11-mic@digikod.net
Signed-off-by: James Morris <jamorris@linux.microsoft.com>
MAINTAINERS
tools/testing/selftests/Makefile
tools/testing/selftests/landlock/.gitignore [new file with mode: 0644]
tools/testing/selftests/landlock/Makefile [new file with mode: 0644]
tools/testing/selftests/landlock/base_test.c [new file with mode: 0644]
tools/testing/selftests/landlock/common.h [new file with mode: 0644]
tools/testing/selftests/landlock/config [new file with mode: 0644]
tools/testing/selftests/landlock/fs_test.c [new file with mode: 0644]
tools/testing/selftests/landlock/ptrace_test.c [new file with mode: 0644]
tools/testing/selftests/landlock/true.c [new file with mode: 0644]