[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8baa42b8-2529-44d8-99e5-341132c09264@citrix.com>
Date: Thu, 17 Oct 2024 23:31:30 +0100
From: Andrew Cooper <andrew.cooper3@...rix.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>, x86@...nel.org
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>, Peter Zijlstra <peterz@...radead.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
Waiman Long <longman@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Michael Ellerman <mpe@...erman.id.au>, linuxppc-dev@...ts.ozlabs.org,
Mark Rutland <mark.rutland@....com>,
"Kirill A . Shutemov" <kirill@...temov.name>
Subject: Re: [PATCH v2 0/6] x86/uaccess: Avoid barrier_nospec()
On 17/10/2024 10:55 pm, Josh Poimboeuf wrote:
> At least for now, continue to assume mask_user_address() is safe on AMD
> when combined with STAC/CLAC -- as get_user(), put_user() and
> masked_user_access_begin() already do today.
Honestly, I find this a very worrying position to take.
It's one thing not to know there's a speculative security vulnerability
with how mask_user_address() is used.
It's totally another to say "lets pretend that it doesn't exist so we
can continue to make things faster".
Even if you can get Intel and AMD to agree that STAC/CLAC are really
LFENCEs (and I think you'll struggle), they'd only confer the safety you
want between a real conditional that excludes the non-canonical range,
and the pointer deference.
Any path that genuinely deferences a non-canonical pointer is not safe,
whatever serialisation you put in the way. The attacker wins the moment
the load uop executes.
The final hunk of patch 1 is safe (iff STAC is given extra guarantees)
because it is between the conditional and the deference. Patch 4 is not
safe (if the comment is correct) because it removes the conditional.
Or state that you intend to disregard this non-canoncal speculation
problem; that's fine(ish) too, as long as it's done transparently.
~Andrew
Powered by blists - more mailing lists