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:   Sun, 19 Sep 2021 13:10:45 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "the arch/x86 maintainers" <x86@...nel.org>
Subject: Re: [GIT pull] locking/urgent for v5.15-rc2

On Sun, Sep 19, 2021 at 11:28 AM Thomas Gleixner <tglx@...utronix.de> wrote:
>
>
> -       atomic_add(READER_BIAS - bias, &rwb->readers);
> +       /*
> +        * _release() is needed in case that reader is in fast path, pairing
> +        * with atomic_try_cmpxchg() in rwbase_read_trylock(), provides RELEASE
> +        */
> +       (void)atomic_add_return_release(READER_BIAS - bias, &rwb->readers);

Ugh. This really needs fixing.

atomic_add() is already much more than release-ordered on x86, and
atomic_add_return_release() is much more expensive on some uarchs.

I think it should be easy to add a atomic_add_release() function, and
it might be as simple as the attached patch, allowing architectures to
add their own arch_atomic_add_release() as needed.

I've pulled this, but please don't do things like the above hack.

            Linus

View attachment "patch.diff" of type "text/x-patch" (1855 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ