Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5173067rwb; Tue, 6 Sep 2022 20:53:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR7p8aNEG/TjQigHvPS7vLmWNc3fTilBW3hWrftV5ESr7pi4uAMW61SrYdX3+0AqIz3Lek9e X-Received: by 2002:a17:907:78d:b0:740:33e1:998 with SMTP id xd13-20020a170907078d00b0074033e10998mr1008503ejb.162.1662522816045; Tue, 06 Sep 2022 20:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662522816; cv=none; d=google.com; s=arc-20160816; b=qfTj3QzP0XNWr2SKizCcasxx6yMKAXdHyvHeTKOjt2FEdSc8uj3UZqHfR1BNuoNylj wxHzL8SNZCZpjzXov5sbeXJMIAnoVk7I42LEKHgbrYer//zZMhJUBeIyl2MSAh69F/+A 4qeDMVCdh6EYj6iGRXMSXO/CCZt2jCqawbIXZc6Gz0HD9vUflCnAe1a0+tem5ZPoGPpl AS4ZB3tEhqvDmsm4SVt1iq0dPf8aAmhNF4oIOJyW8bKFLwUGez0MtSWMS1d+hmUAJYf0 8yP20e9tmlY8Oz2fAtJFbIAql2c7lwBcGbu6A3WRrNe5CgyHtxMlHs9BJiXM4Dgkrdeu mk/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vlkirMfByXPzhCps8z54tw65b5X5xObKeOI7pZLJdWc=; b=XxVKSc79Z//gw2sjYj/Hq2VFTQ+mJULD2uc/e1VZT537HmxEvGdgVilNSfODANHk1y gaHMy/NKMdbweXt5Kolr87BJhC0cNcwHAfFngSwl1HeJuzV/+sQog5QTEEpLZ9Q/Jbl7 fvmXdEr5EpVTP2cQtkLrJbQWb5J/v9J6UV3bmJ+Be7z+gjkMuUF94MRa3KHIXGEV4/Q3 R2kOw673BMntSLA0a1DeysUS0ufwXmX/PuQKdiKz46z/TiTaT+VVZ66qFC9HGT7uzkn/ CKFJzfs9O1GILmRtW5tjycE/c8ULutlmOen62Oe8vzDnOS+lWpRhzyinEeW4HvuP1/q8 vyRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LoWISRHJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt34-20020a1709072da200b0076f061ffab4si3539546ejc.51.2022.09.06.20.53.11; Tue, 06 Sep 2022 20:53:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LoWISRHJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbiIGDp6 (ORCPT + 99 others); Tue, 6 Sep 2022 23:45:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbiIGDpx (ORCPT ); Tue, 6 Sep 2022 23:45:53 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E5092A72C for ; Tue, 6 Sep 2022 20:45:52 -0700 (PDT) Received: from nazgul.tnic (unknown [84.201.196.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7F1DD1EC0523; Wed, 7 Sep 2022 05:45:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1662522344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=vlkirMfByXPzhCps8z54tw65b5X5xObKeOI7pZLJdWc=; b=LoWISRHJdscjvIFngleNb/Qtv3A4Z7OWOGiOstHh5KD7q/FDK0ipFv+5uCVgwSNcRMgAsz 7MsoH6pxgmalG51Re8s8K1oU8A832ruu5Jx3kpdyEluQc9SXUP0uMuMSbc4q/SdvEEi69h pXRmRzmklFFt4YFMKNLxlW7n2lt5lY8= Date: Wed, 7 Sep 2022 05:45:53 +0200 From: Borislav Petkov To: Jiri Slaby Cc: bp@suse.de, tglx@linutronix.de, x86@kernel.org, linux-kernel@vger.kernel.org, Mark Mossberg Subject: Re: [PATCH] x86/dumpstack: Don't mention RIP in "Code:" Message-ID: References: <20220906071123.558-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220906071123.558-1-jslaby@suse.cz> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 06, 2022 at 09:11:23AM +0200, Jiri Slaby wrote: > Commit 238c91115cd0 ("x86/dumpstack: Fix misleading instruction pointer > error message") changed the "Code:" line in bug reports when RIP is an > invalid pointer. In particular, the report currently says (for example): > > BUG: kernel NULL pointer dereference, address: 0000000000000000 > ... > RIP: 0010:0x0 > Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. > > That "Unable to access opcode bytes at RIP 0xffffffffffffffd6." is > quite confusing as RIP value is 0, not -42. That -42 comes from > "regs->ip - PROLOGUE_SIZE", because Code is dumped with some prologue > (and epilogue). > > So do not mention "RIP" on this line in this context. > > Cc: Mark Mossberg > Cc: Borislav Petkov > Signed-off-by: Jiri Slaby > --- > arch/x86/kernel/dumpstack.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c > index afae4dd77495..b3dba35f466e 100644 > --- a/arch/x86/kernel/dumpstack.c > +++ b/arch/x86/kernel/dumpstack.c > @@ -128,7 +128,7 @@ void show_opcodes(struct pt_regs *regs, const char *loglvl) > /* No access to the user space stack of other tasks. Ignore. */ > break; > default: > - printk("%sCode: Unable to access opcode bytes at RIP 0x%lx.\n", > + printk("%sCode: Unable to access opcode bytes at 0x%lx.\n", > loglvl, prologue); > break; > } I guess... and it says "opcode bytes" to denote that it is trying to access instructions so yeah, that RIP might be superfluous. Acked-by: Borislav Petkov -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette