Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5248008imm; Tue, 31 Jul 2018 07:53:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc55DR1SVBSj8SQgwdLktqYrobics0+E12smVdzfKH4+3vkGf3haXqsRU2jpl89QAmYwDTv X-Received: by 2002:a65:58c8:: with SMTP id e8-v6mr20508328pgu.96.1533048791613; Tue, 31 Jul 2018 07:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533048791; cv=none; d=google.com; s=arc-20160816; b=d/AyLpcd4Nw5EKkXUmyX0Fj0O6DBFl5dMAXPk8mVaj9MjBM2YVxH7SCCjr2GwDDx+/ npy8slaI2FDRyOZOxK34oDJ4j0jKIItA5D3clNhUVX2mo0HFeCug2useEVojo5kSr516 fkWGpCufC5YbXbDorP1/7qbXcKcIhwlHY9XRDiMCIwx08XjrAOoqTsDmIp/ybErx98HS 2afqqZwqHS+gfw5avYa7Y7Y5XsCke6d7nztLvTJH5DSLyp4zuG4V6cUM95+jUcIDgpcD 4vCH9M6UVm0vRkqZBdqNqEOYrYQHB0rAuaugYqacXwkZtxATa82343DJSTQFKCfmnr7K PjUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=hcW0KW1SjRbRvCxOhCFuUJskPEgpjEn4Eqmi+OBTYT8=; b=Lj1/HXrfzQkmlKqGROkCecnHsqeQXG4/FDpMK+Zq+grmy6bXlsHK9Zd2ABonL+TDuq cQj95Zr92VTicgOnvjbLBHIp2sRW7+75nkuqIXWZ5X/88bOMlPmm1ofmoZg5H/GHMAyJ 7WR+lK2fthb3ev+E8rlEdCX5AGe0L2Gv5QuyYSZEcFew7GTUL4QA1Wid/atVtdP++TrT KqEAap4gg5Nk+rFB6mlLY9vBM1thNNytqAptbPFDBohSsPTBtzBy+GcCFhoumqf/m0nP 88djCFfPXXwRAZEcq7vUKBXrfG6+swTz8rYuZBRqXEWG5yY+02XmlpksrX6G2F8RCmou +ung== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9-v6si14128276pgr.244.2018.07.31.07.52.57; Tue, 31 Jul 2018 07:53:11 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732600AbeGaQbr (ORCPT + 99 others); Tue, 31 Jul 2018 12:31:47 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34952 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732380AbeGaQbr (ORCPT ); Tue, 31 Jul 2018 12:31:47 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6VE8wLX012906 for ; Tue, 31 Jul 2018 10:51:06 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kjqk4xp7j-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 31 Jul 2018 10:51:05 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Jul 2018 08:51:05 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 31 Jul 2018 08:50:59 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6VEow2238600742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 31 Jul 2018 07:50:58 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 65F76BE056; Tue, 31 Jul 2018 08:50:58 -0600 (MDT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 20811BE053; Tue, 31 Jul 2018 08:50:55 -0600 (MDT) Received: from kermit-br-ibm-com.br.ibm.com (unknown [9.18.235.193]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 31 Jul 2018 08:50:54 -0600 (MDT) From: Murilo Opsfelder Araujo To: linux-kernel@vger.kernel.org Cc: "Alastair D'Silva" , Andrew Donnellan , Balbir Singh , Benjamin Herrenschmidt , Christophe Leroy , Cyril Bur , "Eric W . Biederman" , Joe Perches , Michael Ellerman , Michael Neuling , Murilo Opsfelder Araujo , Nicholas Piggin , Paul Mackerras , Simon Guo , Sukadev Bhattiprolu , "Tobin C . Harding" , linuxppc-dev@lists.ozlabs.org Subject: [PATCH v3 6/9] powerpc: Do not call __kernel_text_address() in show_instructions() Date: Tue, 31 Jul 2018 11:50:17 -0300 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180731145020.14009-1-muriloo@linux.ibm.com> References: <20180731145020.14009-1-muriloo@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18073114-0012-0000-0000-000016941E60 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009463; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01068484; UDB=6.00549299; IPR=6.00846683; MB=3.00022427; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-31 14:51:03 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18073114-0013-0000-0000-000053DDFDFF Message-Id: <20180731145020.14009-7-muriloo@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-31_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807310137 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Modify show_instructions() not to call __kernel_text_address(), allowing userspace instruction dump. probe_kernel_address(), which returns -EFAULT if something goes wrong, is still being called. Signed-off-by: Murilo Opsfelder Araujo --- arch/powerpc/kernel/process.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index e9533b4d2f08..50094c44bf79 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -1283,8 +1283,7 @@ static void show_instructions(struct pt_regs *regs) pc = (unsigned long)phys_to_virt(pc); #endif - if (!__kernel_text_address(pc) || - probe_kernel_address((unsigned int __user *)pc, instr)) { + if (probe_kernel_address((unsigned int __user *)pc, instr)) { pr_cont("XXXXXXXX "); } else { if (regs->nip == pc) -- 2.17.1