[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a2=nfW1YSJoTf_cj5DVSMVfzWYaYqG486FHD3vPw3YZfQ@mail.gmail.com>
Date: Sun, 22 Apr 2018 22:17:18 +0200
From: Arnd Bergmann <arnd@...db.de>
To: "H.J. Lu" <hjl.tools@...il.com>
Cc: Jeffrey Walton <noloader@...il.com>,
"the arch/x86 maintainers" <x86@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
y2038 Mailman List <y2038@...ts.linaro.org>,
LKML <linux-kernel@...r.kernel.org>,
Linux API <linux-api@...r.kernel.org>,
linux-arch <linux-arch@...r.kernel.org>,
GNU C Library <libc-alpha@...rceware.org>,
Deepa Dinamani <deepa.kernel@...il.com>,
Al Viro <viro@...iv.linux.org.uk>,
Albert ARIBAUD <albert.aribaud@...ev.fr>,
linux-s390 <linux-s390@...r.kernel.org>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
"open list:RALINK MIPS ARCHITECTURE" <linux-mips@...ux-mips.org>,
James Hogan <jhogan@...nel.org>,
Ralf Baechle <ralf@...ux-mips.org>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
sparclinux <sparclinux@...r.kernel.org>,
Ben Hutchings <ben@...adent.org.uk>,
Daniel Schepler <dschepler@...il.com>,
Adam Borowski <kilobyte@...band.pl>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
"# 3.4.x" <stable@...r.kernel.org>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] x86: ipc: fix x32 version of shmid64_ds and msqid64_ds
On Sun, Apr 22, 2018 at 2:38 PM, H.J. Lu <hjl.tools@...il.com> wrote:
> On Fri, Apr 20, 2018 at 7:38 AM, Arnd Bergmann <arnd@...db.de> wrote:
>> On Fri, Apr 20, 2018 at 3:53 PM, Jeffrey Walton <noloader@...il.com> wrote:
>
> Glibc has correct header files for system calls. I have a very old
> program to check if Linux kernel header files are correct for user
> space:
>
> https://github.com/hjl-tools/linux-header
>
> It needs update to check uapi.
Simply running 'make' on a regular distro shows this output:
--- kernel.x32.out 2018-04-22 22:10:16.053432423 +0200
+++ glibc.x32.out 2018-04-22 22:10:16.073432838 +0200
@@ -10,9 +10,9 @@ size of daddr_t: 4
size of __ipc_pid_t: 4
size of struct ipc_perm: 48
size of mqd_t: 4
-size of struct msqid_ds: 144
+size of struct msqid_ds: 120
size of struct semid_ds: 104
-size of struct shmid_ds: 136
+size of struct shmid_ds: 112
size of struct shminfo: 72
size of struct timeval: 16
size of struct timespec: 16
@@ -22,8 +22,8 @@ size of struct mq_attr: 64
size of struct rlimit: 16
size of struct rusage: 144
size of struct stat: 144
-size of struct statfs: 64
-size of struct statfs64: 88
+size of struct statfs: 120
+size of struct statfs64: 120
size of struct timex: 208
size of struct msginfo: 32
size of struct msgbuf: 16
This seems plausible, the statfs structure clearly has the same problem
as msqid_ds/shmid_ds based on its usage of '__statfs_word' which is
now defined as '__u32' rather than '__kernel_long_t'.
It should be trivial to override __statfs_word from
arch/x86/include/uapi/asm/statfs.h
I've checked the other uses of __BITS_PER_LONG in the uapi
headers now, and all the others are either not relevant for x32
(either definition is fine) or it has to be __BITS_PER_LONG=32.
Arnd
Powered by blists - more mailing lists