Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4288009pxu; Mon, 21 Dec 2020 08:41:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWgo5Sd17ywaUnSyDNyWhiV3Hwf9e/2PBkqxgFqgPSnX47N66lrxcihOfqTSH7uI1ENkGQ X-Received: by 2002:a17:906:447:: with SMTP id e7mr16037336eja.172.1608568861287; Mon, 21 Dec 2020 08:41:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608568861; cv=none; d=google.com; s=arc-20160816; b=Yg9r3+8wvDWa/vs437PNNY0czELbXW1JRJjFoOgfcBQaNJ9tRVqMreJwplDs7W3MUs tMjcMJhXWw+3AuV/fwAewjxdbQiLQz3ooDBfdG1kh+eFKQtVvq18Y0iVtkU8euQm1STK CwiE/hlYKrvgdwTTEAamZAyGYl8Xkr4hT48cEm9vwlz3O2TOmxXQw32pxQn/w3PeMt6s dmiLMdRGvxlU0+ZmBxAiqfCUw8etHJpQZvX2QQoUX8rP20l/2VCc6Mixwq7bbIpb4em4 Zro0lnnG5QsKY0zk461tCV5cimxhiSNR/TBi2yVnbrCvbQ0R0ofoGO9E4gzKN+9GI2Jf mafA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DRUCLmb6M+99J5o7jAEY9ym/pME2RB5Ti4nvpfSx1s0=; b=Po46PiRXOzjpbyZLmkuao6+7+sHzNGF5UkVTMglNMfGqDG+kl/NoqUtJnsIjPRtfME JQTk8//L7yovmBHDETG48HPWWUUNOCDB68PgrrZDNrmZ80cvw3zKIcC9k9hvUL8M1cpV Wcn3lCaQv4y806seKcd0A8jaimHSDlKMwiF11SCOm1ZLKHo48DOgUN06y317we2lm6Be WQeswRXl7WtT8XgnOPaFaV98ZOQvgCgwSWiJE/7LV0OysL7rAE35nxn4vR+tdhatppHu WRJQQ1oRfJso78u5llQm7Tt3uzDt+cr//TvSJIMmzaPZXW3UgCc9UT22UTghgnWHwUzX zp/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch11si10220344edb.384.2020.12.21.08.40.37; Mon, 21 Dec 2020 08:41:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725816AbgLUQkK (ORCPT + 99 others); Mon, 21 Dec 2020 11:40:10 -0500 Received: from gate.crashing.org ([63.228.1.57]:51030 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbgLUQkJ (ORCPT ); Mon, 21 Dec 2020 11:40:09 -0500 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 0BLGVbM9009946; Mon, 21 Dec 2020 10:31:37 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 0BLGVULx009932; Mon, 21 Dec 2020 10:31:30 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 21 Dec 2020 10:31:30 -0600 From: Segher Boessenkool To: Christophe Leroy Cc: Xiaoming Ni , linux-kernel@vger.kernel.org, benh@kernel.crashing.org, mpe@ellerman.id.au, paulus@samba.org, linuxppc-dev@lists.ozlabs.org, yanaijie@huawei.com, npiggin@gmail.com, ravi.bangoria@linux.ibm.com, mikey@neuling.org, aneesh.kumar@linux.ibm.com, haren@linux.ibm.com, wangle6@huawei.com Subject: Re: [PATCH] powerpc:Don't print raw EIP/LR hex values in dump_stack() and show_regs() Message-ID: <20201221163130.GZ2672@gate.crashing.org> References: <20201221032758.12143-1-nixiaoming@huawei.com> <2279fc96-1f10-0c3f-64d9-734f18758620@csgroup.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2279fc96-1f10-0c3f-64d9-734f18758620@csgroup.eu> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 21, 2020 at 04:17:21PM +0100, Christophe Leroy wrote: > Le 21/12/2020 ? 04:27, Xiaoming Ni a ?crit?: > >Since the commit 2b0e86cc5de6 ("powerpc/fsl_booke/32: implement KASLR > >infrastructure"), the powerpc system is ready to support KASLR. > >To reduces the risk of invalidating address randomization, don't print the > >EIP/LR hex values in dump_stack() and show_regs(). > I think your change is not enough to hide EIP address, see below a dump > with you patch, you get "Faulting instruction address: 0xc03a0c14" As far as I can see the patch does nothing to the GPR printout. Often GPRs contain code addresses. As one example, the LR is moved via a GPR (often GPR0, but not always) for storing on the stack. So this needs more work. Segher