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]
Message-ID: <YlvK9iefUECy361O@gondor.apana.org.au>
Date:   Sun, 17 Apr 2022 16:08:22 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Ard Biesheuvel <ardb@...nel.org>
Cc:     Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>, Marc Zyngier <maz@...nel.org>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Linux Memory Management List <linux-mm@...ck.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH 07/10] crypto: Use ARCH_DMA_MINALIGN instead of
 ARCH_KMALLOC_MINALIGN

On Fri, Apr 15, 2022 at 01:38:15PM +0200, Ard Biesheuvel wrote:
>
> If this is the case, things are already broken today. We never take
> ARCH_DMA_MINALIGN into account when adding the driver ctx size to the
> overall allocation size.

No it's not broken because kmalloc guarantees alignment.  For
example, if ARCH_DMA_MINALIGN is 128 bytes, then kmalloc will
always return a pointer that's 128-byte aligned.  That guarantees
this object and the next object are on different cache-lines.

If you reduce the kmalloc minimum alignment to 64 bytes, then
the two neighbouring objects can share cache-lines, even if
each object is bigger than 128 bytes (e.g., if they were 192
bytes each).

Cheers,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ