[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1704063895.68277.1643024990042.JavaMail.zimbra@efficios.com>
Date: Mon, 24 Jan 2022 06:49:50 -0500 (EST)
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
linux-kernel <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
paulmck <paulmck@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
"H. Peter Anvin" <hpa@...or.com>, Paul Turner <pjt@...gle.com>,
linux-api <linux-api@...r.kernel.org>,
stable <stable@...r.kernel.org>,
Florian Weimer <fw@...eb.enyo.de>,
Andy Lutomirski <luto@...capital.net>,
Dave Watson <davejwatson@...com>,
Andrew Morton <akpm@...ux-foundation.org>,
Russell King <linux@....linux.org.uk>,
Andi Kleen <andi@...stfloor.org>,
Christian Brauner <christian.brauner@...ntu.com>,
Ben Maurer <bmaurer@...com>, rostedt <rostedt@...dmis.org>,
Josh Triplett <josh@...htriplett.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Michael Kerrisk <mtk.manpages@...il.com>,
Joel Fernandes <joelaf@...gle.com>
Subject: Re: [RFC PATCH] rseq: Fix broken uapi field layout on 32-bit little
endian
----- On Jan 24, 2022, at 2:42 AM, Linus Torvalds torvalds@...ux-foundation.org wrote:
> On Sun, Jan 23, 2022 at 9:32 PM Mathieu Desnoyers
> <mathieu.desnoyers@...icios.com> wrote:
>>
>> The rseq rseq_cs.ptr.{ptr32,padding} uapi endianness handling is
>> entirely wrong on 32-bit little endian: a preprocessor logic mistake
>> wrongly uses the big endian field layout on 32-bit little endian
>> architectures.
>>
>> Fortunately, those ptr32 accessors were never used within the kernel,
>> and only meant as a convenience for user-space.
>
> Please don't double down on something that was already broken once.
>
> Just remove the broken 32-bit one entirely that the kernel doesn't
> even use, and make everybody use
>
> __u64 ptr64;
>
> and be done with it.
OK, should I just leave:
struct rseq {
[...]
union rseq_cs {
__u64 ptr64;
} rseq_cs;
[...]
};
and remove all the other content from the union, so users of
rseq_abi->rseq_cs.ptr64 will continue to work as-is with either
old and new headers ? This keeps a union in place with a single
element, so I just want to confirm with you that is what you
have in mind.
It does make tons of sense to just remove the broken convenience
code and let user-space handle this based on the ptr64 field, so
it will work fine with old and new headers.
Thanks for your feedback, and travel safe!
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
Powered by blists - more mailing lists