diff options
author | Andrey Konovalov <andreyknvl@gmail.com> | 2021-09-03 00:57:38 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-09-03 19:58:14 +0300 |
commit | 555999a009aacd90ea51a6690e8eb2a5d0427edc (patch) | |
tree | 5f3cc9a07efe6cc81277bb600074987f11fe14c4 /lib/earlycpio.c | |
parent | 8fbad19bdcb4b9be8131536e5bb9616ab2e4eeb3 (diff) | |
download | linux-555999a009aacd90ea51a6690e8eb2a5d0427edc.tar.xz |
kasan: test: avoid corrupting memory via memset
kmalloc_oob_memset_*() tests do writes past the allocated objects. As the
result, they corrupt memory, which might lead to crashes with the HW_TAGS
mode, as it neither uses quarantine nor redzones.
Adjust the tests to only write memory within the aligned kmalloc objects.
Also add a comment mentioning that memset tests are designed to touch both
valid and invalid memory.
Link: https://lkml.kernel.org/r/64fd457668a16e7b58d094f14a165f9d5170c5a9.1628779805.git.andreyknvl@gmail.com
Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/earlycpio.c')
0 files changed, 0 insertions, 0 deletions