Re: [PATCH 33/64] lib: Introduce CONFIG_TEST_MEMCPY

2021-07-27 Thread Bart Van Assche
On 7/27/21 1:58 PM, Kees Cook wrote: +static int __init test_memcpy_init(void) +{ + int err = 0; + + err |= test_memcpy(); + err |= test_memmove(); + err |= test_memset(); + + if (err) { + pr_warn("FAIL!\n"); + err = -EINVAL; + } els

Re: [PATCH 33/64] lib: Introduce CONFIG_TEST_MEMCPY

2021-07-27 Thread Kees Cook
On Tue, Jul 27, 2021 at 04:31:03PM -0700, Bart Van Assche wrote: > On 7/27/21 1:58 PM, Kees Cook wrote: > > +static int __init test_memcpy_init(void) > > +{ > > + int err = 0; > > + > > + err |= test_memcpy(); > > + err |= test_memmove(); > > + err |= test_memset(); > > + > > + if (err) {

Re: [PATCH 33/64] lib: Introduce CONFIG_TEST_MEMCPY

2021-07-27 Thread Randy Dunlap
On 7/27/21 4:31 PM, Bart Van Assche wrote: > On 7/27/21 1:58 PM, Kees Cook wrote: >> +static int __init test_memcpy_init(void) >> +{ >> +    int err = 0; >> + >> +    err |= test_memcpy(); >> +    err |= test_memmove(); >> +    err |= test_memset(); >> + >> +    if (err) { >> +    pr_warn("FAIL

[PATCH 33/64] lib: Introduce CONFIG_TEST_MEMCPY

2021-07-27 Thread Kees Cook
Before changing anything about memcpy(), memmove(), and memset(), add run-time tests to check basic behaviors for any regressions. Signed-off-by: Kees Cook --- lib/Kconfig.debug | 3 + lib/Makefile | 1 + lib/test_memcpy.c | 285 ++ 3 files ch