aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/landlock/Makefile (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-10-19selftests/landlock: Build without static librariesMickaël Salaün1-3/+4
The only (forced) static test binary doesn't depend on libcap. Because using -lcap on systems that don't have such static library would fail (e.g. on Arch Linux), let's be more specific and require only dynamic libcap linking. Fixes: a52540522c95 ("selftests/landlock: Fix out-of-tree builds") Cc: Anders Roxell <anders.roxell@linaro.org> Cc: Guillaume Tucker <guillaume.tucker@collabora.com> Cc: Mark Brown <broonie@kernel.org> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün <mic@digikod.net> Link: https://lore.kernel.org/r/20221019200536.2771316-1-mic@digikod.net
2022-09-14selftests/landlock: Fix out-of-tree buildsMickaël Salaün1-9/+10
These changes simplify the Makefile and handle these 5 ways to build Landlock tests: - make -C tools/testing/selftests/landlock - make -C tools/testing/selftests TARGETS=landlock gen_tar - make TARGETS=landlock kselftest-gen_tar - make TARGETS=landlock O=build kselftest-gen_tar - make -C /tmp/linux TARGETS=landlock O=/tmp/build kselftest-gen_tar This also makes $(KHDR_INCLUDES) available to other test collections when building in their directory. Fixes: f1227dc7d041 ("selftests/landlock: fix broken include of linux/landlock.h") Fixes: 3bb267a36185 ("selftests: drop khdr make target") Cc: Anders Roxell <anders.roxell@linaro.org> Cc: Guillaume Tucker <guillaume.tucker@collabora.com> Cc: Mark Brown <broonie@kernel.org> Cc: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Mickaël Salaün <mic@digikod.net> Link: https://lore.kernel.org/r/20220909103402.1501802-1-mic@digikod.net
2022-08-15selftests/landlock: fix broken include of linux/landlock.hGuillaume Tucker1-2/+5
Revert part of the earlier changes to fix the kselftest build when using a sub-directory from the top of the tree as this broke the landlock test build as a side-effect when building with "make -C tools/testing/selftests/landlock". Reported-by: Mickaël Salaün <mic@digikod.net> Fixes: a917dd94b832 ("selftests/landlock: drop deprecated headers dependency") Fixes: f2745dc0ba3d ("selftests: stop using KSFT_KHDR_INSTALL") Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-07-14selftests/landlock: drop deprecated headers dependencyGuillaume Tucker1-7/+2
The khdr make target has been removed, so drop it from the landlock Makefile dependencies as well as related include paths that are standard for headers in the kernel tree. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> Reported-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-07-11selftests: stop using KSFT_KHDR_INSTALLGuillaume Tucker1-1/+0
Stop using the KSFT_KHDR_INSTALL flag as installing the kernel headers from the kselftest Makefile is causing some issues. Instead, rely on the headers to be installed directly by the top-level Makefile "headers_install" make target prior to building kselftest. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> Tested-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-23selftests: landlock: Add the uapi headers include variableMuhammad Usama Anjum1-1/+1
Out of tree build of this test fails if relative path of the output directory is specified. Add the KHDR_INCLUDES to correctly reach the headers. Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: Mickaël Salaün <mic@linux.microsoft.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-04-22selftests/landlock: Add user space testsMickaël Salaün1-0/+24
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>