linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] selftests: landlock: fix runs on older systems
@ 2023-08-09 17:04 Andre Przywara
  2023-08-09 17:04 ` [PATCH 1/2] selftests: landlock: allow other ABI versions Andre Przywara
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andre Przywara @ 2023-08-09 17:04 UTC (permalink / raw)
  To: Mickaël Salaün, Shuah Khan
  Cc: linux-security-module, linux-kselftest, linux-kernel

When naively running all kselftests on some systems, it was observed
that the landlock selftest is quite picky and reports failures, even
though the system is fine.

Those two patches relax some tests to make them pass on older kernels:
- The landlock ABI version is only "3" in recent kernels, so patch 1/2
  relaxes the test to accept other numbers.
- Older kernels or some defconfig based kernels might not implement
  the landlock syscall at all. Patch 2/2 catches this.

I couldn't find an easy way to not check for the syscall availability in
*every* test in base_test.c, short of not using TEST_HARNESS_MAIN at all.
If someone has a better idea, I am all ears, especially as this approach
will get quite annoying in fs_base.c.

Cheers,
Andre

Andre Przywara (2):
  selftests: landlock: allow other ABI versions
  selftests: landlock: skip all tests without landlock syscall

 tools/testing/selftests/landlock/base_test.c | 29 +++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-17 17:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09 17:04 [PATCH 0/2] selftests: landlock: fix runs on older systems Andre Przywara
2023-08-09 17:04 ` [PATCH 1/2] selftests: landlock: allow other ABI versions Andre Przywara
2023-08-09 17:04 ` [PATCH 2/2] selftests: landlock: skip all tests without landlock syscall Andre Przywara
2023-08-17 17:26   ` Mickaël Salaün
2023-08-17 17:25 ` [PATCH 0/2] selftests: landlock: fix runs on older systems Mickaël Salaün

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).