linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Andre Przywara <andre.przywara@arm.com>
Cc: Shuah Khan <shuah@kernel.org>,
	linux-security-module@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] selftests: landlock: fix runs on older systems
Date: Thu, 17 Aug 2023 19:25:32 +0200	[thread overview]
Message-ID: <20230817.geeciXohlu4c@digikod.net> (raw)
In-Reply-To: <20230809170435.1312162-1-andre.przywara@arm.com>

Hi Andre,

On Wed, Aug 09, 2023 at 06:04:33PM +0100, Andre Przywara wrote:
> 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.

Indeed, the current Landlock test suite only checks for the Landlock ABI
of the same source tree as the kselftest files, hence the strict
abi_version test.

> 
> 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.

I'd like to take such changes but we need to be more generic, and if
possible avoid being too verbose.

For the more generic part, tests should be skipped according to the
Landlock ABI of the running kernel: i.e. a test should pass iff
ABI >= N.

For the verbosity improvements, we can rely on new macros as explain in
the following email.

> 
> 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
> 

      parent reply	other threads:[~2023-08-17 17:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Mickaël Salaün [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230817.geeciXohlu4c@digikod.net \
    --to=mic@digikod.net \
    --cc=andre.przywara@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).