]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kasan: test: avoid writing invalid memory
authorAndrey Konovalov <andreyknvl@gmail.com>
Mon, 23 Aug 2021 23:59:24 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:34:02 +0000 (09:34 +1000)
commit1b20e9ea1aa1cb365bc9da5e80ca2c5067865179
tree1c74e09a1da36615c40cce2ccfdebc5405cab95c
parent9f386bf717678790619ef35cdf268d4dc71521a2
kasan: test: avoid writing invalid memory

Multiple KASAN tests do writes past the allocated objects or writes to
freed memory.  Turn these writes into reads to avoid corrupting memory.
Otherwise, these tests might lead to crashes with the HW_TAGS mode, as it
neither uses quarantine nor redzones.

Link: https://lkml.kernel.org/r/c3cd2a383e757e27dd9131635fc7d09a48a49cf9.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: Stephen Rothwell <sfr@canb.auug.org.au>
lib/test_kasan.c