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: <5c3635a2b44a496b88d665e8686d9436@AcuMS.aculab.com>
Date:   Mon, 12 Apr 2021 10:53:24 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Christoph Hellwig' <hch@....de>,
        'Catalin Marinas' <catalin.marinas@....com>,
        'Will Deacon' <will@...nel.org>,
        "'Thomas Bogendoerfer'" <tsbogend@...ha.franken.de>,
        "'James E.J. Bottomley'" <James.Bottomley@...senPartnership.com>,
        'Helge Deller' <deller@....de>,
        'Michael Ellerman' <mpe@...erman.id.au>,
        'Heiko Carstens' <hca@...ux.ibm.com>,
        'Vasily Gorbik' <gor@...ux.ibm.com>,
        "'Christian Borntraeger'" <borntraeger@...ibm.com>,
        "'David S. Miller'" <davem@...emloft.net>,
        "'x86@...nel.org'" <x86@...nel.org>,
        'Arnd Bergmann' <arnd@...db.de>
CC:     "'linux-arch@...r.kernel.org'" <linux-arch@...r.kernel.org>,
        "'linux-s390@...r.kernel.org'" <linux-s390@...r.kernel.org>,
        "'linux-parisc@...r.kernel.org'" <linux-parisc@...r.kernel.org>,
        "'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>,
        "'linux-mips@...r.kernel.org'" <linux-mips@...r.kernel.org>,
        "'sparclinux@...r.kernel.org'" <sparclinux@...r.kernel.org>,
        "'linuxppc-dev@...ts.ozlabs.org'" <linuxppc-dev@...ts.ozlabs.org>,
        "'linux-arm-kernel@...ts.infradead.org'" 
        <linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition

From: David Laight
> Sent: 12 April 2021 10:37
...
> I'm guessing that compat_pid_t is 16 bits?
> So the native 32bit version has an unnamed 2 byte structure pad.
> The 'packed' removes this pad from the compat structure.
> 
> AFAICT (apart from mips) the __ARCH_COMPAT_FLOCK_PAD is just
> adding an explicit pad for the implicit pad the compiler
> would generate because compat_pid_t is 16 bits.

I've just looked at the header.
compat_pid_t is 32 bits.
So Linux must have gained 32bit pids at some earlier time.
(Historically Unix pids were 16 bit - even on 32bit systems.)

Which makes the explicit pad in 'sparc' rather 'interesting'.

Actually the tail pad can just be removed from the compat
structures.
Just a comment that mips and sparc have extra fields
in the uapi header is enough.

The kernel never needs to read/write the pad.
userspace must provide the pad in case the kernel writes it.

oh - compat_loff_t is only used in a couple of other places.
neither care in any way about the alignment.
(Provided get_user() doesn't fault on a 8n+4 aligned address.)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ