Received: by 10.223.185.116 with SMTP id b49csp3088711wrg; Mon, 5 Mar 2018 14:00:22 -0800 (PST) X-Google-Smtp-Source: AG47ELuSp1l3zr4nP6djYouiDztLJmJJOrW7ngvh6tE204qrSIYpQMoCb6NWENBsRJ+PaJQcQPKz X-Received: by 10.98.216.137 with SMTP id e131mr16883669pfg.17.1520287222386; Mon, 05 Mar 2018 14:00:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520287222; cv=none; d=google.com; s=arc-20160816; b=QeoIGTmSQ6xk1+387KiLBQqu9/Q4FeybftHV6m5r2MpgorlUztI9ZhXgJQyejuUJuG zEi/yGZussCR8SoqO8mlmul2X7YWINXVRQJn+g5cL5Cglt9OOre8utJ1PbKmrloM7+dk RT4wy3lnjiBclaDvH59x7VCGDD8HDdrFQAYAsaXgAx1soP++XZ6uU5U6rKu/NKq4uEBP XrdVxF69uPjc5QItl7vbhFX5UQAoX5k44JQ3mx+eqyodA5Lvhnu8u+XBGT2kTUhttEY8 Kcqtc6ZG/hXmofxLIEtmlPx7bOcNeBlPIXOhszFxyGNuv6gJvQKTEWcEMbAC2Xs26dm0 BNRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=D8+sDlZ04A6nU8lPrFC+GGw5cVy+BdRREk66oqQ5sYE=; b=G5oaOpC2SNTWn8H7aEIvL4biyhBtGs0mbRSdumwHRq6TeyRn7AlB2N5NLMxIDKm6En x9soHIddpQ4KiNATrIiG5UUTRucZMZwKs1dEUv/3eb55Ir52UO6UMEbWUw9o3XVJzxaj nQQvtAxkcXzammHheDiNIZIczyxo3llvcH8XPeDG1ljyMj568aPnMWRygNy4h3IM+hvs BFHZ2JLp5H5sbCqqAKU8tYD8sBwY6uukCasNsIYXYO1pvWo+egy+Cefc1jiFijP+OJlN LdzF4aTIr2+YCKVcmFBWtLmT/k4Qq39LMU5bZlISpBTVmqaTBbVGpcFJ3JP4R5iPktcW WsaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=SCzKqx0Q; dkim=fail header.i=@linux-foundation.org header.s=google header.b=U5O9dcgX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3-v6si9931707plb.480.2018.03.05.14.00.07; Mon, 05 Mar 2018 14:00:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=SCzKqx0Q; dkim=fail header.i=@linux-foundation.org header.s=google header.b=U5O9dcgX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753255AbeCEV6f (ORCPT + 99 others); Mon, 5 Mar 2018 16:58:35 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:33394 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752480AbeCEV6d (ORCPT ); Mon, 5 Mar 2018 16:58:33 -0500 Received: by mail-io0-f193.google.com with SMTP id f1so19733335iob.0 for ; Mon, 05 Mar 2018 13:58:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=D8+sDlZ04A6nU8lPrFC+GGw5cVy+BdRREk66oqQ5sYE=; b=SCzKqx0Qutt1HTkfHV1kyzD2pogkpv4iotuBUCowQO/y5AAVM4+5qGm3Eh5dOdcqej Zmm3OnaMLw+Lg1iClUnaQlQW/epVrUVar4EdbyEdRciLq+HXAmKfl5yqxrLM8v/h+/SN UMjuvZMor3wAY5vmeBoT/Mes6kLIMCasVyfS3J2xhm7e2uJpsMG3J6mlL8uc3LclxD6k cRoYMGzzGOJcJdqLLf881HyzYPHbwsTI1lDXMVJ+N/4bq7d1GVR4Ri1gkZIjJnHdHbFu 8zQnjs99SvuuVcAarGQ2+/ev0UmLcAITKBdZ5AdMbHE6wSD+AOCNhrZuh9u//CWGiznM ws6A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=D8+sDlZ04A6nU8lPrFC+GGw5cVy+BdRREk66oqQ5sYE=; b=U5O9dcgXVNW+CdScl93eUUZBTLn+MkxDr25G3jP2kV0KHwvAiPdlb6J8xo36NRBp10 4tzg7UF80znhF4xigXrBoMzYg0EqfqANzk1PzFsb5zYLd2tPYx2o6gMcKVX8MzAvdKTe BtAKRxAak+LcofAa5ygiETbRctkI/6EXkx2Jc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=D8+sDlZ04A6nU8lPrFC+GGw5cVy+BdRREk66oqQ5sYE=; b=FI6PazFyl1CZB9JoJbnPmFTvhSDjvNm3WhcvmGe8eibY29tp7V+3hhyLSTMkGJeS/g KIkUACKcUhBchZKqT6Q58uD8Wx8ysH2wp8nps6hjly8pTXVEhr0he/eFlU92hV6DZUOL m9s83BzUR2izlR09Me7/OEwFoKII/+4w2bdfGLw3Ue0ubZoq6/9j2m+pKFtzuVmbPr0X 7bADlWT+rAT7Liq7r1VS8Zj2wWQAPbfCxdwAawuTpC+OkHxWFzi6A5mivb6EMpLRymI0 9s7KlNnoERqabl/irA1ylmYqn+7qvaRBn6O2yW5JaG+fmsG8YIHwqPfCPiB78pVuoiwE 497g== X-Gm-Message-State: APf1xPBmH+citsbeamvgn6VW21Exd23TDm94vdBQJRXs5zP/2pd2iA3E UyoODJ+jnaiJ6aIXnVMQwPwpse6UEvgGjsZG1yA= X-Received: by 10.107.12.213 with SMTP id 82mr18748030iom.48.1520287113063; Mon, 05 Mar 2018 13:58:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.135.221 with HTTP; Mon, 5 Mar 2018 13:58:32 -0800 (PST) In-Reply-To: <20180305213550.GV16484@8bytes.org> References: <1520245563-8444-1-git-send-email-joro@8bytes.org> <1520245563-8444-8-git-send-email-joro@8bytes.org> <20180305131231.GR16484@8bytes.org> <20180305213550.GV16484@8bytes.org> From: Linus Torvalds Date: Mon, 5 Mar 2018 13:58:32 -0800 X-Google-Sender-Auth: RN-OJg34hhXtaWx9CRJX-Kh71s4 Message-ID: Subject: Re: [PATCH 07/34] x86/entry/32: Restore segments before int registers To: Joerg Roedel Cc: Brian Gerst , Thomas Gleixner , Ingo Molnar , Peter Anvin , "the arch/x86 maintainers" , Linux Kernel Mailing List , linux-mm , Andrew Lutomirski , Dave Hansen , Josh Poimboeuf , =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , David Laight , Denys Vlasenko , Eduardo Valentin , Greg Kroah-Hartman , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Pavel Machek , Joerg Roedel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 5, 2018 at 1:35 PM, Joerg Roedel wrote: > On Mon, Mar 05, 2018 at 12:50:33PM -0800, Linus Torvalds wrote: >> >> Ahh, good. So presumably Joerg actually did check it, just didn't even notice ;) > > Yeah, sort of. I ran the test, but it didn't catch the failure case in > previous versions which was return to user with kernel-cr3 :) Ahh. Yes, that's bad. The NX protection to guarantee that you don't return to user mode was really good on x86-64. So some other case could slip through, because user code can happily run with the kernel page tables. > I could probably add some debug instrumentation to check for that in my > future testing, as there is no NX protection in the user address-range > for the kernel-cr3. Does not NX work with PAE? Oh, it looks like the NX bit is marked as "RSVD (must be 0)" in the PDPDT. Oh well. Linux