Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753332AbeAQOR6 (ORCPT + 1 other); Wed, 17 Jan 2018 09:17:58 -0500 Received: from mga09.intel.com ([134.134.136.24]:53955 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752343AbeAQORz (ORCPT ); Wed, 17 Jan 2018 09:17:55 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,372,1511856000"; d="scan'208";a="166826348" Message-ID: <1516198646.4184.13.camel@linux.intel.com> Subject: Re: [PATCH v3 8/9] x86: use __uaccess_begin_nospec and ASM_IFENCE in get_user paths From: Alan Cox To: Linus Torvalds , Dan Williams Cc: Linux Kernel Mailing List , linux-arch@vger.kernel.org, Andi Kleen , Kees Cook , kernel-hardening@lists.openwall.com, Greg Kroah-Hartman , the arch/x86 maintainers , Ingo Molnar , Al Viro , "H. Peter Anvin" , Thomas Gleixner , Andrew Morton Date: Wed, 17 Jan 2018 14:17:26 +0000 In-Reply-To: References: <151586744180.5820.13215059696964205856.stgit@dwillia2-desk3.amr.corp.intel.com> <151586748981.5820.14559543798744763404.stgit@dwillia2-desk3.amr.corp.intel.com> Organization: Intel Corporation Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.6 (3.24.6-1.fc26) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, 2018-01-16 at 14:41 -0800, Linus Torvalds wrote: > > > On Jan 16, 2018 14:23, "Dan Williams" > wrote: > > That said, for get_user specifically, can we do something even > > cheaper. Dave H. reminds me that any valid user pointer that gets > > past > > the address limit check will have the high bit clear. So instead of > > calculating a mask, just unconditionally clear the high bit. It > > seems > > worse case userspace can speculatively leak something that's > > already > > in its address space. > > That's not at all true. > > The address may be a kernel address. That's the whole point of > 'set_fs()'. Can we kill off the remaining users of set_fs() ? Alan