kmsan: introduce test_memcpy_initialized_gap()
authorAlexander Potapenko <glider@google.com>
Mon, 11 Sep 2023 14:57:02 +0000 (16:57 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 4 Oct 2023 17:32:22 +0000 (10:32 -0700)
commit46fa84a2b920f91780db3347de81d65efb668301
tree7ffa95c3ad32ae59be324d6ab48292b205698800
parentc3ab4873c8d3620493042123471e65b5e2c37b2c
kmsan: introduce test_memcpy_initialized_gap()

Add a regression test for the special case where memcpy() previously
failed to correctly set the origins: if upon memcpy() four aligned
initialized bytes with a zero origin value ended up split between two
aligned four-byte chunks, one of those chunks could've received the zero
origin value even despite it contained uninitialized bytes from other
writes.

Link: https://lkml.kernel.org/r/20230911145702.2663753-4-glider@google.com
Signed-off-by: Alexander Potapenko <glider@google.com>
Suggested-by: Marco Elver <elver@google.com>
Acked-by: Marco Elver <elver@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kmsan/kmsan_test.c