RE: [RFC PATCH v0 0/6] x86/AMD: Userspace address tagging

From: David Laight
Date: Thu Mar 10 2022 - 09:54:49 EST


From: Bharata B Rao <bharata@xxxxxxx>
> Sent: 10 March 2022 11:16
>
> This patchset makes use of Upper Address Ignore (UAI) feature available
> on upcoming AMD processors to provide user address tagging support for x86/AMD.
>
> UAI allows software to store a tag in the upper 7 bits of a logical
> address [63:57]. When enabled, the processor will suppress the
> traditional canonical address checks on the addresses. More information
> about UAI can be found in section 5.10 of 'AMD64 Architecture
> Programmer's Manual, Vol 2: System Programming' which is available from
>
> https://bugzilla.kernel.org/attachment.cgi?id=300549

Is that really allowing bit 63 to be used?
That is normally the user-kernel bit.
I can't help feeling that will just badly break things.

Otherwise the best thing is just to change access_ok()
to only reject addresses with the top bit set.
Then you shouldn't need any extra tests in the fast-path
of access_ok().

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)