Received: by 10.223.185.116 with SMTP id b49csp830551wrg; Sat, 10 Feb 2018 21:26:55 -0800 (PST) X-Google-Smtp-Source: AH8x2249pwD8RXTDznLXWRzsY5HqN/tol1bzEu+Rc81qImyZdEim7L1QP7RrDWuQaiTDgmWiS5u4 X-Received: by 10.98.130.193 with SMTP id w184mr7802262pfd.111.1518326815785; Sat, 10 Feb 2018 21:26:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518326815; cv=none; d=google.com; s=arc-20160816; b=OGrpUFKx0fjh7xFNhgnkzPb4jhGkXzOvfTt9njT2UOKdI0BIyBNA9Lne0IxHwYQTq7 D6s85mIvspDdxWEbjkWZiLAML9mGmsRgJh5uUXGKG41sOw9T04zRF+qa2e1atZ2Swbr1 qCFrZuWrFx12pOdldfF52sOLjsJy4wkj8ZdvriPrJ3M7sGcyK/NqNmrXzPaRRYzf4+QG RWG2UccZrkxUeRwjJ67wcLd21kTye2jw/HghpjoqhBV4wKag/B3wfgGK2M6wSm2v88VY 6v+uJy/CPQ4vJFGVtc5xt1IMexnTsgOCQlWvujI7JHi0dwkhzDehWRM5Moj6MtfDvXae xWXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=/wEeb5Pje8iz/njZ3syyAucI9imh6LzMcld1BSjd7+s=; b=O8LQmjLxKP1A0TGaTFW2pdxKDa5av6e/eGsF+SG8WrX8zb8xSaDp6CWuEC6Aa77PFa bQkxnqeT1OLXWlzlZxVAtuQXkR3CDZuzFuE1KJxrg9SgPd8CB+vLFa3CeXBiSAeocTDv jDX9fK3Q0MmeagW91tPZL5QO+BMLJunvrU1JIkl/VnEs3e0Ri+FKmo1a2HFICBdIv1ww qQ3fV1G0jtKrfFVE3UpBrOcSmJwkERgeFIoIfMlUrHD35H7LB6m4mVPZMAhDM49lDVdV /gXPHdVnGl6k55jlgTCRrNccv2ru0C56g/zK4f9k+8Hvw9gxqnFegiPI/WvtrASckNqe 439g== ARC-Authentication-Results: i=1; mx.google.com; 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 s84si2162606pfi.366.2018.02.10.21.26.42; Sat, 10 Feb 2018 21:26:55 -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; 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 S1753945AbeBKFYD (ORCPT + 99 others); Sun, 11 Feb 2018 00:24:03 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41331 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752529AbeBKEdk (ORCPT ); Sat, 10 Feb 2018 23:33:40 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ekjKd-0002hD-0x; Sun, 11 Feb 2018 04:33:39 +0000 Received: from ben by deadeye with local (Exim 4.90) (envelope-from ) id 1ekjKZ-0004Xn-2j; Sun, 11 Feb 2018 04:33:35 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Lepton Wu" , "Guenter Roeck" , "Juerg Haefliger" , "Greg Kroah-Hartman" Date: Sun, 11 Feb 2018 04:20:06 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.2 79/79] kaiser: Set _PAGE_NX only if supported In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.2.99-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Lepton Wu This finally resolve crash if loaded under qemu + haxm. Haitao Shan pointed out that the reason of that crash is that NX bit get set for page tables. It seems we missed checking if _PAGE_NX is supported in kaiser_add_user_map Link: https://www.spinics.net/lists/kernel/msg2689835.html Reviewed-by: Guenter Roeck Signed-off-by: Lepton Wu Signed-off-by: Greg Kroah-Hartman (backported from Greg K-H's 4.4 stable-queue) Signed-off-by: Juerg Haefliger Signed-off-by: Ben Hutchings --- arch/x86/mm/kaiser.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/x86/mm/kaiser.c +++ b/arch/x86/mm/kaiser.c @@ -189,6 +189,8 @@ static int kaiser_add_user_map(const voi * requires that not to be #defined to 0): so mask it off here. */ flags &= ~_PAGE_GLOBAL; + if (!(__supported_pte_mask & _PAGE_NX)) + flags &= ~_PAGE_NX; if (flags & _PAGE_USER) BUG_ON(address < FIXADDR_START || end_addr >= FIXADDR_TOP);