Re: [PATCH v4 8/8] selftests/lsm: add lockdown securityfs test

From: Guicai Ma

Date: Mon Nov 30 2026 - 06:51:59 EST


On Mon, Nov 30, 2026 at 04:29:14PM +0800, Cai Xinchen wrote:
> Use the shared file read helper from common.c instead of duplicating
> it, and share the read checks between the tests through a fixture
> setup. The root and writability checks run in the tests that write,
> so that the read-only tests also work when run unprivileged.
>
> Suggested-by: Guicai Ma <maguicai@xxxxxxxxxx>
> Signed-off-by: Cai Xinchen <caixinchen1@xxxxxxxxxx>

Thanks for addressing the v3 comments.

I re-tested this on arm64/KVM (mainline 9437ee8b6cf6 with the series
applied, KASAN and lockdep enabled). As uid 65534, read_format and
unprivileged_open_eacces pass while the four write tests skip. As root,
none -> integrity (5 pass, 1 skip), integrity -> confidentiality
(5 pass, 1 skip), and already-confidentiality (4 pass, 2 skip) all
behave as expected. On a build without CONFIG_SECURITY_LOCKDOWN_LSM_EARLY
booted with lsm=yama, all 6 tests skip on ENOENT. No KASAN or lockdep
warnings.

Tested-by: Guicai Ma <maguicai@xxxxxxxxxx>