This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RE: [PATCH 1/2] uapi: split openat2(2) definitions from fcntl.h
- From: David Laight <David dot Laight at ACULAB dot COM>
- To: 'Aleksa Sarai' <cyphar at cyphar dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, Alexander Viro <viro at zeniv dot linux dot org dot uk>, Jeff Layton <jlayton at kernel dot org>, "J. Bruce Fields" <bfields at fieldses dot org>, Shuah Khan <shuah at kernel dot org>, "Christian Brauner" <christian dot brauner at ubuntu dot com>, "dev at opencontainers dot org" <dev at opencontainers dot org>, "containers at lists dot linux-foundation dot org" <containers at lists dot linux-foundation dot org>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, "linux-api at vger dot kernel dot org" <linux-api at vger dot kernel dot org>, "linux-fsdevel at vger dot kernel dot org" <linux-fsdevel at vger dot kernel dot org>, "linux-kernel at vger dot kernel dot org" <linux-kernel at vger dot kernel dot org>, "linux-kselftest at vger dot kernel dot org" <linux-kselftest at vger dot kernel dot org>
- Date: Fri, 20 Dec 2019 10:18:23 +0000
- Subject: RE: [PATCH 1/2] uapi: split openat2(2) definitions from fcntl.h
- References: <20191219105533.12508-1-cyphar@cyphar.com> <20191219105533.12508-2-cyphar@cyphar.com> <87a77oy3oe.fsf@oldenburg2.str.redhat.com> <20191219134525.mgzmjbsp4wo5b2bw@yavin.dot.cyphar.com> <845fc9e8b55e4868bb4d20655e674b50@AcuMS.aculab.com> <20191220093153.v7jpzvch3lohabll@yavin.dot.cyphar.com>
From: Aleksa Sarai
> Sent: 20 December 2019 09:32
...
> > I'm guessing that is just 64bit aligned on 32bit archs like x86?
>
> Yeah,
>
> #define __aligned_u64 __u64 __attribute__((aligned(8)))
>
> > No need to enforce it provided the structure will have no padding on
> > archs where the 64bit fields are 64bit aligned. A plain __u64 should
> > be fine.
>
> Will this cause problems for x86-on-x86_64 emulation? Requiring an
> 8-byte alignment for 'struct open_how' really isn't that undue of a
> burden IMHO. Then again, clone3 is a bit of an outlier since both
> perf_event_open and sched_setattr just use __u64s.
Makes diddly-squit difference.
The 64bit kernel will 64bit align the structure.
The kernel must allow for the userspace structure having arbitrary alignment.
So there is no reason to (try to) align the user structure.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)