lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 12 Jan 2021 09:18:24 +0100
From:   Alexander Potapenko <>
To:     Andrey Konovalov <>
Cc:     Catalin Marinas <>,
        Vincenzo Frascino <>,
        Dmitry Vyukov <>,
        Marco Elver <>,
        Andrew Morton <>,
        Will Deacon <>,
        Andrey Ryabinin <>,
        Evgenii Stepanov <>,
        Branislav Rankov <>,
        Kevin Brodsky <>,
        kasan-dev <>,
        Linux ARM <>,
        Linux Memory Management List <>,
        LKML <>
Subject: Re: [PATCH 07/11] kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL

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 you seen this happen in practice?
Are these accesses to fail_data that are optimized (in which case we
could make it volatile), or some part of the expression?
Note that compiler barriers won't probably help against removing
memory accesses, they only prevent reordering.

> +       barrier();                                              \
>         expression;                                             \
> +       barrier();                                              \

The need for barriers is not obvious to the reader, so a comment in
the code clarifying that would be nice.

Powered by blists - more mailing lists