lists.openwall.net   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  linux-cve-announce  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:   Thu, 2 Mar 2023 15:48:29 +0100
From:   Alexander Potapenko <glider@...gle.com>
To:     Marco Elver <elver@...gle.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, x86@...nel.org,
        dave.hansen@...ux.intel.com, hpa@...or.com,
        akpm@...ux-foundation.org, dvyukov@...gle.com, nathan@...nel.org,
        ndesaulniers@...gle.com, kasan-dev@...glegroups.com
Subject: Re: [PATCH 2/4] kmsan: another take at fixing memcpy tests

> > +#define DO_NOT_OPTIMIZE(var) asm("" ::: "memory")
>
> That's just a normal "barrier()" - use that instead?

Ok, will do (I still think I'd better hide it behind a macro so that
we can change the implementation of DO_NOT_OPTIMIZE in the future if
the compiler starts outsmarting us again.

> > +/*
> > + * Test case: ensure that memcpy() correctly copies initialized values.
> > + */
> > +static void test_init_memcpy(struct kunit *test)
> > +{
> > +       EXPECTATION_NO_REPORT(expect);
> > +       volatile int src;
> > +       volatile int dst = 0;
> > +
> > +       // Ensure DO_NOT_OPTIMIZE() does not cause extra checks.
>
> ^^ this comment seems redundant now, given DO_NOT_OPTIMIZE() has a
> comment (it's also using //-style comment).

Moved it to the test description:

/*
 * Test case: ensure that memcpy() correctly copies initialized values.
 * Also serves as a regression test to ensure DO_NOT_OPTIMIZE() does not cause
 * extra checks.
 */

I think it's still relevant here.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ