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: <2cc687eb-bef0-4fbe-983a-e3b9dde6caae@gigawatt.nl>
Date:   Mon, 11 Sep 2023 00:40:04 +0100
From:   Harald van Dijk <harald@...awatt.nl>
To:     Florian Weimer <fweimer@...hat.com>
Cc:     Andy Lutomirski <luto@...nel.org>,
        Jessica Clarke <jrtc27@...c27.com>,
        Rich Felker <dalias@...c.org>, linux-x86_64@...r.kernel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] x86: Fix x32 System V message queue syscalls

On 01/08/2023 13:15, Harald van Dijk wrote:
> On 01/08/2023 08:15, Florian Weimer wrote:
>> * Harald van Dijk:
>>
>>> There is one complication that I think has not been mentioned yet:
>>> when _GNU_SOURCE is defined, glibc does provide a definition of struct
>>> msghdr in <sys/msg.h> with a field "__syscall_slong_t mtype;". This
>>> makes it slightly more likely that there is code out there in the wild
>>> that works fine with current kernels and would be broken by the
>>> fix. Given how rare x32 is, and how rare message queues are, this may
>>> still be acceptable, but I am mentioning it just in case this would
>>> cause a different approach to be preferred. And whatever is done, a
>>> fix should also be submitted to glibc.
>>
>> What should glibc do here?  Just change the definition in the header to
>> long and ignore the breakage?
> 
> Yes, I believe so, but perhaps for glibc it might make sense to wait a 
> little bit to see if it does indeed go into the kernel in that form. If 
> the kernel ends up preferring something else, the change needed in glibc 
> might also be different.

With the patches sent just now, following the guidance from Andy in 
<https://lore.kernel.org/all/CALCETrUuBR3Pt_9NhRZTLzjZzwdsS2OPW4U2r31_1Uq-=poRDw@mail.gmail.com/>, 
assuming they get accepted, the right thing to do in glibc would indeed 
be to just change the header to use long. It will not affect anything 
other than x32, and most code avoids that header anyway and defines the 
type manually as per the documentation.

Cheers,
Harald van Dijk

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ