]> git.ipfire.org Git - thirdparty/linux.git/commit - lib/memcpy_kunit.c
kunit/memcpy: Add dynamic size and window tests
authorKees Cook <keescook@chromium.org>
Wed, 28 Sep 2022 21:17:05 +0000 (14:17 -0700)
committerKees Cook <keescook@chromium.org>
Fri, 28 Oct 2022 23:07:57 +0000 (16:07 -0700)
commit96fce387d58fa8eae6e8d9b1ecdfbc18292d7a68
treede98db88e53664f58502ddd7871a0d46b1553101
parent03699f271de1f4df6369cd379506539cd7d590d3
kunit/memcpy: Add dynamic size and window tests

The "side effects" memmove() test accidentally found[1] a corner case in
the recent refactoring of the i386 assembly memmove(), but missed another
corner case. Instead of hoping to get lucky next time, implement much
more complete tests of memcpy() and memmove() -- especially the moving
window overlap for memmove() -- which catches all the issues encountered
and should catch anything new.

[1] https://lore.kernel.org/lkml/CAKwvOdkaKTa2aiA90VzFrChNQM6O_ro+b7VWs=op70jx-DKaXA@mail.gmail.com

Cc: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
MAINTAINERS
lib/memcpy_kunit.c