Re: [PATCH] string: Convert strscpy() self-test to KUnit
From: Kees Cook
Date: Tue Oct 18 2022 - 15:01:24 EST
On Tue, Oct 18, 2022 at 11:54:28AM -0700, Nathan Chancellor wrote:
> On Tue, Oct 18, 2022 at 01:28:59AM -0700, Kees Cook wrote:
> > Convert the strscpy() self-test to a KUnit test.
> >
> > Cc: David Gow <davidgow@xxxxxxxxxx>
> > Cc: Tobin C. Harding <tobin@xxxxxxxxxx>
> > Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
>
> I ran the following commands and they all passed:
>
> $ tools/testing/kunit/kunit.py run --arch arm64 --cross_compile aarch64-linux-gnu- strscpy
>
> $ tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 strscpy
>
> $ tools/testing/kunit/kunit.py run --arch x86_64 strscpy
>
> $ tools/testing/kunit/kunit.py run --arch x86_64 --make_options LLVM=1 strscpy
>
> Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
Thank you!
I should probably note somewhere that I test it both with and without
CONFIG_FORTIFY_SOURCE:
$ tools/testing/kunit/kunit.py run --arch x86_64 --kconfig_add CONFIG_FORTIFY_SOURCE=y strscpy
etc...
--
Kees Cook