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:   Tue, 5 Jun 2018 16:43:04 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Mark Rutland <mark.rutland@....com>, linux-kernel@...r.kernel.org,
        Boqun Feng <boqun.feng@...il.com>,
        Will Deacon <will.deacon@....com>, Jiri Slaby <jslaby@...e.com>
Subject: Re: [PATCH 1/7] atomics/tty: add missing atomic_long_t * cast

On Tue, Jun 05, 2018 at 04:20:51PM +0200, Greg Kroah-Hartman wrote:
> I think Peter Hurley was just trying to hid the atomic mess behind
> function calls, which is why he didn't open-code it like you did here.

No reason to then not use the right types though. I mean, you can still
use the helper functions, but I figured they weren't worth the bother.
Esp. then using try_cmpxchg (which is relatively new) the helpers became
very thin.

> But this makes it a bit more obvious as to what "magic" is happening, so
> I like it.

Well, it also fixes one additional bug in that the old code used a
regular unsigned long load of the value:

-       long count = sem->count;
+       long count = atomic_long_read(&sem->count);

which doesn't guarantee enough. The atomic_long_read() thing implies
READ_ONCE() which ensures the load is single copy atomic (GCC used to
guarantee that for regular loads/stores to naturally aligned native
words, but no longer).

> Care to turn it into a real patch so I can queue it up after 4.18-rc1 is
> out?  Or do you want me to do that?

I can make a proper patch, hold on.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ