Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2753517imj; Mon, 11 Feb 2019 08:00:15 -0800 (PST) X-Google-Smtp-Source: AHgI3Iasr/H1CrSkHcopA230Wcl5r8ymeI6aSopc5eOeL1qotC3tJnbQjAWMf/60KduKMawWqeCL X-Received: by 2002:a62:e515:: with SMTP id n21mr24027268pff.159.1549900815137; Mon, 11 Feb 2019 08:00:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900815; cv=none; d=google.com; s=arc-20160816; b=oDdioPP8zUtGX95Zv+rUVjscHww203zOrsSpfiU2CD8CDLnr7V3Rq+UI+MfhRho3UO Qe10q+i6vbIq6QZHjjgk45gH2J1i9KtatlRub8IHa1RtosHNBWMxVgPvhTyRKi7u+ICl sslckH5Tb7JYqiQ8cZSLcTYRUcUTUqh9ppbwj7bS6NLYcA6QMBZry595jo51CQ9sOHjK FsAohCEjiBVmpLe7LyUaaLfiRdp9SgZb77MNBC/4TzcIT9rY93qhr1pwJ0NGq9lFM9cT ChaGGCWTRzDs0Y7ZCgdpVuRKQJxa1CcIw2BZd67mQWMFVVA44PkfiIEsKVL7rGfl6hAh ScLA== 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=NYYNTyV7e6FcAoAK9bUFKN4N+dYrEtKxosUN1Oa+sCY=; b=Ijbb5o+Q6A3G7XVIkFQQDFhGEreUjIV362W6xmUU2Ixh+uQiPjBxASozkL4inAMTPA Ya9OSxgRRw7lDzBvgJHrbXAPGB7O5u1jh3aXYXL6jGR7LvmJ1xoJWrcpnUIAI9qRdxhg KM4fZuuWmAGNruK63XxxNcXg/OZd3Li5uAy43q4JXO7NvBh9c+1boUKONueMj++u0q5e oP3w/LYv3klmwoqCFL3ANKVbSP6fgVXCNM6/2llkOCSwUTi1ssRBQElgWswCC9KbszcL m9fIvAdK5tKGtTGCDK9PrgafqMWTNBvFWqOi5R8/te7YLQEb+sut0j2ZmNT9vL6MyCHM BtEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bA6ji38S; 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 c11si739824plo.109.2019.02.11.07.59.58; Mon, 11 Feb 2019 08:00:15 -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=bA6ji38S; 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 S1730805AbfBKP67 (ORCPT + 99 others); Mon, 11 Feb 2019 10:58:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:39978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730194AbfBKOcd (ORCPT ); Mon, 11 Feb 2019 09:32:33 -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 E4B4D20844; Mon, 11 Feb 2019 14:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895552; bh=oGg5iQVgAh9anK6wyEm98yTwIRFqFSuqdZaexuZLnA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bA6ji38ShWkrJmeMyyZxkzcqyJoQpmUP6ZEeqaOoUpXlX6otSzx+iQ2bdHw+vClCU pALqUgz00eU/dhe1GCL70M0JNWA46zp84X/x37sN7iztza8JumPlNIHf1GGeEOqWBd E4rhQITKRDcoTp1N5lV4kTefo+oALx1Rfyfiw0M8= 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.20 241/352] powerpc/mm: Fix reporting of kernel execute faults on the 8xx Date: Mon, 11 Feb 2019 15:17:48 +0100 Message-Id: <20190211141902.496412047@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@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.20-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 1697e903bbf2..50e5c790d11e 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -226,7 +226,9 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, 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