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]
Date:   Fri, 14 Dec 2018 12:13:01 -0800
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Andy Lutomirski <luto@...capital.net>
Cc:     dalias@...c.org, fweimer@...hat.com, bernd@...rovitsch.priv.at,
        glaubitz@...sik.fu-berlin.de, Andrew Lutomirski <luto@...nel.org>,
        "the arch/x86 maintainers" <x86@...nel.org>,
        Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
        linux-api@...r.kernel.org, Peter Anvin <hpa@...or.com>,
        Peter Zijlstra <peterz@...radead.org>, bp@...en8.de,
        vapier@...too.org, hjl.tools@...il.com, x32@...ldd.debian.org,
        Arnd Bergmann <arnd@...db.de>,
        Will Deacon <will.deacon@....com>,
        Catalin Marinas <catalin.marinas@....com>
Subject: Re: Can we drop upstream Linux x32 support?

On Fri, Dec 14, 2018 at 10:58 AM Andy Lutomirski <luto@...capital.net> wrote:
>
> Does anyone know *why* Linux’s x32 has __kernel_long_t defined as long long?

It *needs* to be long long, since the headers are used for builds in
user mode using ILP32.

Since __kernel_long_t is a 64-bit (the _kernel_ is not ILP32), you
need to use "long long" when building in ILP32.

Obviously, it could be something like

   #ifdef __KERNEL__
    typedef long __kernel_long_t;
   #else
    typedef long long __kernel_long_t;
   #endif

or similar to make it more obvious what's going on.

Or we could encourage all the uapi header files to always just use
explicit sizing like __u64, but some of the structures really end up
being "kernel long size" for sad historical reasons. Not lovely, but
there we are..

              Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ