[LTP] [PATCH 3/4] {delete, finit, init}_module0[1-3]: Skip on SecureBoot

Petr Vorel pvorel@suse.cz
Fri Jul 21 10:51:38 CEST 2023


Hi Martin,

> > +++ b/testcases/kernel/syscalls/delete_module/delete_module01.c
> > @@ -52,6 +52,8 @@ static struct tst_test test = {
> >   	.needs_root = 1,
> >   	/* lockdown requires signed modules */
> >   	.skip_in_lockdown = 1,
> > +	/* SecureBoot requires signed modules */

> Nit: the two comments could be merged into one.
+1

...
> > @@ -102,9 +104,16 @@ static void run(unsigned int n)
> >   {
> >   	struct tcase *tc = &tcases[n];
> > -	if (tc->skip_in_lockdown && kernel_lockdown) {
> > -		tst_res(TCONF, "Kernel is locked down, skipping %s", tc->name);
> > -		return;
> > +	if (tc->skip_in_lockdown) {
> > +		if (secure_boot) {
> > +			tst_res(TCONF, "SecureBoot enabled, skipping %s", tc->name);
> > +			return;
> > +		}
> > +
> > +		if (kernel_lockdown) {
> > +			tst_res(TCONF, "Kernel is locked down, skipping %s", tc->name);
> > +			return;
> > +		}

> It'd be better to just change the original TCONF message to something like
> "Cannot load unsigned modules, skipping %s". Adding a TINFO message
> "Lockdown on/off" to tst_lockdown_enabled() would provide the explanation
> why.

+1

Kind regards,
Petr


More information about the ltp mailing list