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: <CAHk-=wj3Q7CkMQYwfZSsqUTqkEhNwVGrRbCwe7AVJ70S8i5sWw@mail.gmail.com>
Date:   Fri, 30 Nov 2018 12:40:52 -0800
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Linux List Kernel Mailing <linux-kernel@...r.kernel.org>
Subject: Re: [GIT PULL] Driver core fix for 4.20-rc5

On Fri, Nov 30, 2018 at 8:06 AM Greg KH <gregkh@...uxfoundation.org> wrote:
>
> It resolves an issue with the data alignment in 'struct devres' for the
> ARC platform.  The full details are in the commit changelog, but the
> short summary is the change is a single line:
>
> -       unsigned long long              data[]; /* guarantee ull alignment */
> +       u8 __aligned(ARCH_KMALLOC_MINALIGN) data[];

Hmm.

Are you aware that this is up to 128 bytes? Including on common
architectures like ARM64?

I've done the pull, but honestly, that seems a bit excessive, when a
fair amount of devres users seem to have fairly small data (ie looking
at "size", I see things like

    p = devres_alloc(dmam_device_release, sizeof(void *), GFP_KERNEL);

or

    dr = devres_alloc(devm_gpio_release, sizeof(unsigned), GFP_KERNEL);

that have allocations of a couple of bytes, and the new model means
that those allocations will be aligned to 128-byte boundaries, and
then (because ARCH_KMALLOC_MINALIGN, again) you'll end up actually
wasting 256 bytes for a tiny structure on ARM64.

Maybe it doesn't matter. But it does seem somewhat excessive to do
things like this.

Yeah, on x86, the alignment isn't even noticeable, being just 8 bytes.

                   Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ