Re: [PATCH 07/11] kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL

2021-01-12 Thread Andrey Konovalov
On Tue, Jan 12, 2021 at 8:50 PM Andrey Konovalov wrote: > > On Tue, Jan 12, 2021 at 9:18 AM Alexander Potapenko wrote: > > > > On Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov > > wrote: > > > > > > It might not be obvious to the compiler that the expression must be > > > executed between

Re: [PATCH 07/11] kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL

2021-01-12 Thread Andrey Konovalov
On Tue, Jan 12, 2021 at 9:18 AM Alexander Potapenko wrote: > > On Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov 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

Re: [PATCH 07/11] kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL

2021-01-12 Thread Marco Elver
On Tue, Jan 05, 2021 at 07:27PM +0100, Andrey Konovalov 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. >

Re: [PATCH 07/11] kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL

2021-01-12 Thread Alexander Potapenko
On Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov 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. Have

[PATCH 07/11] kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL

2021-01-05 Thread Andrey Konovalov
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.