Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp899750imm; Fri, 27 Jul 2018 08:01:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdlGh4UpfVSkXGKpKW9BcAeLm9FK/Ozdqs1KLJbZUVdjP/bnEaF/+QsGC2LNwso9N6EdEyq X-Received: by 2002:a63:ec14:: with SMTP id j20-v6mr6384918pgh.28.1532703698673; Fri, 27 Jul 2018 08:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532703698; cv=none; d=google.com; s=arc-20160816; b=DlK66lmaXQVg3lXIKEtyG2urdGc0p8LiVAhGYwLaRekTiFjpmHTotr+zTFkATFXzUl r/8lLrhSyipNJ6Ldh2cyUkZ8FRPmndiV8zr7cH+5Dj9o3eonZ2+Pl2fU95CBZ+zZ+UvL h3cljyzn/6u+Um4va+N32ckaW3QVFik4ox4RfEUTCOy0pebwpZLlOycmcqdX+htpnOTK g35pisUl4MNalWX/fDlPADcTt+3Zr4K0N0jZXBIxGeWlUWsWvboIDQKOp99VJZ4qhvqp b7ixnDWdmjI+CLfzJd8oyArg7SNyAafMY9+kD339sFoiglLWBHsH9JzMB58Hp1P2GYVc E0EQ== 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=8qi5BZgRZeZdIbE9oTJuHN8zJrkOWVLf0noP0qSNKts=; b=vLQ4J/zszHenN+ySkHxBS4qnB7vJxti+mBvkenG5SRDBcGLlH01mrg1m6y0bLfQIlU +Z32Sv+ApNmK2vAJKoMc4IoN/xvmX0dgaJV1xxe+In8wJe7/ZyrcF+sxwXj9OXe4+5OU jvCkzxXkBkClKLrhCjZ/sVuHkv1EgQKMICSenbbwGDgQQklp/BqY6KDujr8Hr2JuosB2 dcgbK8WWurINpHUeYYRyE0VR3uzmMTvyXdUVML2zqhvbMLnisYfI5fKbQNvlPNJIWuI3 sA0Bzsfoux36PNFZYVzg1gT6KRcE6w2jfjXVrC0WNFSSm03sTUzqLwNqu2pvkVixMQBh 6feA== 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 j4-v6si3555798pll.101.2018.07.27.08.01.23; Fri, 27 Jul 2018 08:01:38 -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 S2388893AbeG0QVx (ORCPT + 99 others); Fri, 27 Jul 2018 12:21:53 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40062 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732981AbeG0QVw (ORCPT ); Fri, 27 Jul 2018 12:21:52 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6RExNVZ035492 for ; Fri, 27 Jul 2018 10:59:34 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kg4n8ty8f-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Jul 2018 10:59:33 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Jul 2018 10:59:33 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 27 Jul 2018 10:59:29 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6RExS787471426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 27 Jul 2018 14:59:28 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AE175AC066; Fri, 27 Jul 2018 11:00:10 -0400 (EDT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8F1BBAC059; Fri, 27 Jul 2018 11:00:05 -0400 (EDT) Received: from kermit-br-ibm-com.ibmmodules.com (unknown [9.80.82.251]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 27 Jul 2018 11:00:05 -0400 (EDT) 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" , 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 v2 07/10] powerpc: Do not call __kernel_text_address() in show_instructions() Date: Fri, 27 Jul 2018 11:58:08 -0300 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180727145811.12334-1-muriloo@linux.ibm.com> References: <20180727145811.12334-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: 18072714-0072-0000-0000-00000386AA5F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009438; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01066907; UDB=6.00548186; IPR=6.00844773; MB=3.00022354; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-27 14:59:32 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18072714-0073-0000-0000-000048DD38A4 Message-Id: <20180727145811.12334-8-muriloo@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-27_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=994 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807270154 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 25b562c21b7b..04960796fcce 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