[LTP] [PATCH] syscalls/keyctl/keyctl09.c: fix test encrypted key

Petr Vorel pvorel@suse.cz
Wed Oct 12 16:51:57 CEST 2022


Hi all,

> Hi!
> > > This commit fixes the test for adding encrypted keys with unencrypted data.
> > > Unencryted data must be provided hex-ascii encoding. Due to a kernel
> > > bug, the unencypted data was not decoded to binary thus the length of
> > > the key was only half the specified key size. This patch doubles the key
> > > size and adds a test with a wrong key size to trigger a corresponding
> > > error.

> > > This patch must be used with the kernel fix
> > > https://lore.kernel.org/lkml/20220919072317.E41421357@mail.steuer-voss.de

> > Petr, please correct me if I'm wrong.  Changing an existing LTP test so
> > that it only works on kernels with the kernel patch applied, doesn't
> > sound right.  The test should emit a warning if the original "valid
> > payload" successfully loads.

> We also have a policy not to work around any kernel bugs. So if this
> really fixes a kernel bug it's okay that the test will fail on older
> kernels without this fix and the patch that fixes kernel should be added
> as a tag to the test.

@Nikolaus, FYI:
https://github.com/linux-test-project/ltp/wiki/C-Test-API#138-test-tags

But the patchset has not been even accepted by kernel maintainer - searching in
the kernel thread, looking into
https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm.git/
and to the next tree.
Or am I wrong and it has been accepted?

Even once (if ever) the patch is accepted I agree with Mimi it'd be better to
add new test than change existing old (better for diagnostic what exactly went
wrong).

Kind regards,
Petr


More information about the ltp mailing list