Thread (28 messages) flat view 28 messages, 3 authors, 2021-01-15

Re: [PATCH v3 08/15] kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL

From: Alexander Potapenko <glider@google.com>
Date: 2021-01-15 14:12:50
Also in: linux-arm-kernel, lkml

On Thu, Jan 14, 2021 at 8:36 PM Andrey Konovalov [off-list ref] wrote:
It might not be obvious to the compiler that the expression must be
executed between writing and reading to fail_data. In this case, the
compiler might reorder or optimize away some of the accesses, and
the tests will fail.

Add compiler barriers around the expression in KUNIT_EXPECT_KASAN_FAIL
and use READ/WRITE_ONCE() for accessing fail_data fields.

Link: https://linux-review.googlesource.com/id/I046079f48641a1d36fe627fc8827a9249102fd50
Reviewed-by: Marco Elver <elver@google.com>
Signed-off-by: Andrey Konovalov <redacted>
Reviewed-by: Alexander Potapenko <glider@google.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help