Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2718618imj; Mon, 11 Feb 2019 07:27:40 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia4p98wfZ84eEr34hlpgQFxk7eLO5e89Hc6hdNA9/8IxTuImIPSbzURG1tYDhgovEPmApiW X-Received: by 2002:a17:902:f091:: with SMTP id go17mr38539430plb.235.1549898859934; Mon, 11 Feb 2019 07:27:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549898859; cv=none; d=google.com; s=arc-20160816; b=ac8K14D1ffNb5VJfYSmAYBQ4fNw+GcNOpcw+7lRU5D6k12d7os0Ke+4GLUJBrPLQL/ fYXTxYUYxMESCTMMQS8w8eRzkia3KsCQ9ixLgBPpwtBGjLzgvJRrg5UbQr+llK23S2Q2 lwcVYd6PPSi+FA/CpoN7KRSfJnjBfPgRmTw7khHym2dI6npXlyIzxpx4BSxmpdB8DqDE NkCWU/N/ONnowFdF9fnNdhMr6BdgesVknCFpN+96DWnhr7QThCvJxCs4YIBzhuHg7JzP RrP4Kq3xrl+3n/M4zPQjB+eqq2EW5XgvH5LXe1f7B0U6IBgZRfyiOJ169W/7sZ7sfQuO 2qVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qE9L/W2+jGkKdqxMT4Gz4cTRDqa4EIIgjRmKkwiWGFs=; b=KpbaWy4X0VmrWaVqHAufTGE8bGaLjz3b9VESeMR7hfvxccNYnEQ45SdKWnRgibCQaM JCOwQk+ojhS3+tfMhaQ4/tLzFwS9Y5p5jcBecVBbOd23zwC2Rado7saxoG+kFhDvlOh8 K4mLiiM8dnbpWDMRi6HumtsBlyC/P/JGVJVT9wwGWbFYwRb2UxJ1oWFXq5rmwpEUdc18 htzNqkdxGSQZCKFkyU8WQnnqd/6EMRHdAqutxiKUw4SXq2sbKqef1Bhah9JC2Uu0uz8E a55R6iXbuD8GSXiQxdvKsM0EJaMIj1G4ThqvPm4XY936vRQc3doxWeRwZxz0me+Yo1tR 9nwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qN7BWDK2; 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 c1si9456595pgt.247.2019.02.11.07.27.21; Mon, 11 Feb 2019 07:27:39 -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=pass header.i=@kernel.org header.s=default header.b=qN7BWDK2; 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 S2389976AbfBKPAS (ORCPT + 99 others); Mon, 11 Feb 2019 10:00:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:48148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389465AbfBKPAQ (ORCPT ); Mon, 11 Feb 2019 10:00:16 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B91BE21773; Mon, 11 Feb 2019 15:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897215; bh=6y/QdhOPm1lJOdSu4vQyoPU9Ji3wwxGw/wkZhlF9na0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qN7BWDK2AZIFxIqhynv0GLNWo+3jq+8cS8pYKpY1SHGdOIFtPYy61PK1Q6gJ0ASoX JDNssXl0lr1UX3ZLwTDMJ/yPHkw7/A9BwT40kNq4eMFP6B90A5X5WtIYDXhKc91NDZ ZuZdCoR/skd5nb5sju5w/bvrUQEI2ZlARYOHRFEY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 129/205] powerpc/mm: Fix reporting of kernel execute faults on the 8xx Date: Mon, 11 Feb 2019 15:18:47 +0100 Message-Id: <20190211141836.874786059@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit ffca395b11c4a5a6df6d6345f794b0e3d578e2d0 ] On the 8xx, no-execute is set via PPP bits in the PTE. Therefore a no-exec fault generates DSISR_PROTFAULT error bits, not DSISR_NOEXEC_OR_G. This patch adds DSISR_PROTFAULT in the test mask. Fixes: d3ca587404b3 ("powerpc/mm: Fix reporting of kernel execute faults") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/mm/fault.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 6e1e39035380..52863deed65d 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -215,7 +215,9 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault) static bool bad_kernel_fault(bool is_exec, unsigned long error_code, unsigned long address) { - if (is_exec && (error_code & (DSISR_NOEXEC_OR_G | DSISR_KEYFAULT))) { + /* NX faults set DSISR_PROTFAULT on the 8xx, DSISR_NOEXEC_OR_G on others */ + if (is_exec && (error_code & (DSISR_NOEXEC_OR_G | DSISR_KEYFAULT | + DSISR_PROTFAULT))) { printk_ratelimited(KERN_CRIT "kernel tried to execute" " exec-protected page (%lx) -" "exploit attempt? (uid: %d)\n", -- 2.19.1