|
Message-ID: <20180112204126.257jubn2hccgtzdt@treble> Date: Fri, 12 Jan 2018 14:41:26 -0600 From: Josh Poimboeuf <jpoimboe@...hat.com> To: Linus Torvalds <torvalds@...ux-foundation.org> Cc: Dan Williams <dan.j.williams@...el.com>, Linux Kernel Mailing List <linux-kernel@...r.kernel.org>, linux-arch@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>, Kees Cook <keescook@...omium.org>, kernel-hardening@...ts.openwall.com, X86 ML <x86@...nel.org>, Ingo Molnar <mingo@...hat.com>, Al Viro <viro@...iv.linux.org.uk>, "H. Peter Anvin" <hpa@...or.com>, Thomas Gleixner <tglx@...utronix.de>, Andrew Morton <akpm@...ux-foundation.org>, Alan Cox <alan@...ux.intel.com> Subject: Re: [PATCH v2 07/19] x86: introduce __uaccess_begin_nospec and ASM_IFENCE On Fri, Jan 12, 2018 at 12:01:04PM -0800, Linus Torvalds wrote: > On Fri, Jan 12, 2018 at 11:26 AM, Dan Williams <dan.j.williams@...el.com> wrote: > > > > By the time we get to de-reference uptr we know it is not pointing at > > kernel memory, because access_ok would have failed and the cpu would > > have waited for that failure result before doing anything else. > > I'm not actually convinced that's right in the original patches, > exactly because of the issue that Josh pointed out: even if there is a > comparison inside access_ok() that will be properly serialized, then > that comparison can (and sometimes does) just cause a truth value to > be generated, and then there might be *another* comparison of that > return value after the lfence. And while the return value is table, > the conditional branch on that comparison isn't. > > The new model of just doing it together with the STAC should be fine, though. Aha, that clears it up for me, thanks. I was still thinking about the previous version of the patch which had the barrier in access_ok(). I didn't realize the new version moved the barrier to after the access_ok() checks. -- Josh
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.