From patchwork Fri Jun 9 15:35:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Kristina_Mart=C5=A1enko?= X-Patchwork-Id: 9778839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2659260350 for ; Fri, 9 Jun 2017 15:36:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05DDF2864B for ; Fri, 9 Jun 2017 15:36:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF0EA2864D; Fri, 9 Jun 2017 15:36:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 84A012864B for ; Fri, 9 Jun 2017 15:36:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HvdVghbPf3Ucqycf+RBg0TGJrzdZtUyf8YZdrgN8ziY=; b=YBBZIURLzQPWnJm45xO9NZ4QNX XXLpAIccUmEO5axneFSZEFrJpeRXKO5pOzNXN5Iz3VxirnMSSiVyTBrCyqbuVwk6SWVTyy4TcqC0D 2XWRlgYJMuxPFuSMohH0VbfT59IqkqzdrK4W0LnWKjAILlk2h3x3D5jyLelE3xDL6s3Kn2LnhQadh uMtaSZFhIU9SBlu4slE0bRA8bF10SoNT/DRcvM2oTOkUKrhBAo0YmdFLnOS8IGTq7Ng7T2/p58UF8 eJIa7Cz1qdjo7FGx1U/2WIsedS1RJT92GMPLn922XCNsNju9MUkwlcE/eMbNYDYbQ40e0270vyW7Z l3Sjh85Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dJLxz-0004So-MW; Fri, 09 Jun 2017 15:36:51 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dJLxw-0004Gp-8P for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2017 15:36:49 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 223F91596; Fri, 9 Jun 2017 08:36:31 -0700 (PDT) Received: from moonbear.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 622F13F557; Fri, 9 Jun 2017 08:36:30 -0700 (PDT) From: Kristina Martsenko To: Will Deacon , Catalin Marinas Subject: [PATCH v2 2/3] arm64: mm: don't print out page table entries on EL0 faults Date: Fri, 9 Jun 2017 16:35:53 +0100 Message-Id: <1497022554-1451-2-git-send-email-kristina.martsenko@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1497022554-1451-1-git-send-email-kristina.martsenko@arm.com> References: <1497022554-1451-1-git-send-email-kristina.martsenko@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170609_083648_300565_B4EFADEE X-CRM114-Status: UNSURE ( 8.47 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When we take a fault from EL0 that can't be handled, we print out the page table entries associated with the faulting address. This allows userspace to print out any current page table entries, including kernel (TTBR1) entries. Exposing kernel mappings like this could pose a security risk, so don't print out page table information on EL0 faults. (But still print it out for EL1 faults.) This also follows the same behaviour as x86, printing out page table entries on kernel mode faults but not user mode faults. Signed-off-by: Kristina Martsenko Acked-by: Mark Rutland --- v2: - mention x86 in commit message arch/arm64/mm/fault.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index a9dfb37c87a2..b070dcd50ed0 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -259,7 +259,6 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr, pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n", tsk->comm, task_pid_nr(tsk), inf->name, sig, addr, esr); - show_pte(addr); __show_regs(regs); }