From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754042AbdKFROE (ORCPT ); Mon, 6 Nov 2017 12:14:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48024 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753335AbdKFROD (ORCPT ); Mon, 6 Nov 2017 12:14:03 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D819D7F7B0 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Mon, 6 Nov 2017 11:14:01 -0600 From: Josh Poimboeuf To: "Liu, Changcheng" Cc: Petr Mladek , Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] lib_backtrace: fix kernel text address leak Message-ID: <20171106171401.4h546bbvdon45or2@treble> References: <20171106052511.GB69364@sofia> <20171106080528.GA1298@jagdpanzerIV> <20171106105203.GC69364@sofia> <20171106131147.ouihd4ug5ah3vb6a@treble> <20171106164847.GD69364@sofia> <20171106165648.GA95243@sofia> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20171106165648.GA95243@sofia> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 06 Nov 2017 17:14:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 07, 2017 at 12:56:48AM +0800, Liu, Changcheng wrote: > Don't leak idle function address in NMI backtrace. > > Signed-off-by: Liu Changcheng > > diff --git a/lib/nmi_backtrace.c b/lib/nmi_backtrace.c > index 46e4c749..61a6b5a 100644 > --- a/lib/nmi_backtrace.c > +++ b/lib/nmi_backtrace.c > @@ -93,8 +93,8 @@ bool nmi_cpu_backtrace(struct pt_regs *regs) > if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) { > arch_spin_lock(&lock); > if (regs && cpu_in_idle(instruction_pointer(regs))) { > - pr_warn("NMI backtrace for cpu %d skipped: idling at pc %#lx\n", > - cpu, instruction_pointer(regs)); > + pr_warn("NMI backtrace for cpu %d skipped: idling at %pS\n", > + cpu, (void *)instruction_pointer(regs)); > } else { > pr_warn("NMI backtrace for cpu %d\n", cpu); > if (regs) Sorry, I had a typo in my suggestion. The subject prefix should be: "nmi_backtrace" instead of "lib_backtrace". Also, when posting a followup patch, please remove the "Re: " from the subject so that it's clear that it's a new patch, and not a comment for the old one. Otherwise it looks great to me. Thanks! -- Josh