[PATCH v3 8/8] selftests/lsm: add lockdown securityfs test
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Nov 26 12:55:34 UTC 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] selftests/lsm: missing $(OUTPUT) prefix in run_lockdown_test
target
--
commit ae0a97bf5c81e3abb82a38d806d0a81d48473b52
Author: Cai Xinchen <caixinchen1 at huawei.com>
selftests/lsm: add lockdown securityfs test
This commit adds a kselftest for the lockdown securityfs interface along
with a shared file-reading helper and a custom run_lockdown_test make
target.
> diff --git a/tools/testing/selftests/lsm/Makefile b/tools/testing/selftests/lsm/Makefile
> index 3f80c0bc093de..3be7aa42761ce 100644
> --- a/tools/testing/selftests/lsm/Makefile
> +++ b/tools/testing/selftests/lsm/Makefile
> @@ -8,10 +8,18 @@ LOCAL_HDRS += common.h
> TEST_GEN_PROGS := lsm_get_self_attr_test lsm_list_modules_test \
> lsm_set_self_attr_test
>
> +# lockdown_test changes the machine's lockdown level, so do not run it
> +# by default.
> +TEST_GEN_PROGS_EXTENDED := lockdown_test
> +
> include ../lib.mk
>
> $(OUTPUT)/lsm_get_self_attr_test: lsm_get_self_attr_test.c common.c
> $(OUTPUT)/lsm_set_self_attr_test: lsm_set_self_attr_test.c common.c
> $(OUTPUT)/lsm_list_modules_test: lsm_list_modules_test.c common.c
> +$(OUTPUT)/lockdown_test: lockdown_test.c common.c
> +
> +run_lockdown_test: all
> + $(call RUN_TESTS, lockdown_test)
[Severity: Medium]
Does run_lockdown_test fail when building with an out-of-tree OUTPUT
directory? The binary is built at $(OUTPUT)/lockdown_test (and lib.mk
rewrites TEST_GEN_PROGS_EXTENDED with the $(OUTPUT)/ prefix), so passing
a bare lockdown_test to RUN_TESTS causes runner.sh to look in the source
directory and fail with a missing file error. Passing
$(OUTPUT)/lockdown_test or $(TEST_GEN_PROGS_EXTENDED) to RUN_TESTS would
avoid this.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261126131315.1256553-1-caixinchen1@huawei.com?part=8
More information about the Linux-security-module-archive
mailing list