Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2977023imu; Mon, 19 Nov 2018 08:53:16 -0800 (PST) X-Google-Smtp-Source: AJdET5eE+S/6BuuKW9F+TjTDDWiNlZoceL/1z1pWJvgO8lql8aw96rhUmuF0dJhYnt+aBZTzs8Pg X-Received: by 2002:a63:66c6:: with SMTP id a189mr20851152pgc.167.1542646396318; Mon, 19 Nov 2018 08:53:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542646396; cv=none; d=google.com; s=arc-20160816; b=S6m97LUguqIvtV0vfhMTcLmg8cUj/Nzu2xhi6HErnipuNUTrpBYOV9wS+23RKapYeW Bqn6aOj9hSgvgyMcEnMLs4RkPn7z+4SvDfgg0gcyVVoEX3NrHMTv1xlU40Ad85V6COcK c7FdTXXBBJiqWhHvwr1z4c1DInrgw7ONU8kLVrIoxYFrfXoSrgAECJnsDNp6Ouw1eEzm hIgjaxoyDvyK263cBvMutUWdQI4dgMAFjEf4K2jpgkd6zn05ziVL5F4Ws4JCw33z8pYA 4kshuypW5jVpNaXvP46Sgc20wSrLy2fScF2EPixlH35h8Py09rkaWQX4+wiv4U7VrWkb JxSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p4vJXGMu6V/Yi5n8hhd8cu032QrTivpT7L70H/ts1Jo=; b=bD8ckfpEri1B5gipFYhoRrAOc0vOKq5pczRkt1ZULgvZ5E7SdSJtSsCbqBtu8IBLkP nm7mk5oQX4176JBe0UBQMcMOfJbXApCZBRLVXt8AnkTH84rS+f6aXzF8NU6rSDZ4Zc71 3TyWwL14HQfQ7+2e/J59UHCBq0ycs3oDFVHs929WQbd/6XYdf1PW0Tfwgrv/TCm7I8rc KSCRup4j1NlsCGmwQRCMqIlsWIhWLdYAkhFcOfR0NMxcr9ZkyMmRYCh/yPqFx6Cb0Lj2 y/8jrmkhzu/SbwrfMJDIxmrSRkZE7Bese0OuIZSmBRFfqUfyo7Rdf6+HlcOy+rmzMZVS Gtng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pUm6BXS0; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b94-v6si43181200plb.396.2018.11.19.08.53.01; Mon, 19 Nov 2018 08:53:16 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=pUm6BXS0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390133AbeKTDPC (ORCPT + 99 others); Mon, 19 Nov 2018 22:15:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:52496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388976AbeKTDPB (ORCPT ); Mon, 19 Nov 2018 22:15:01 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 34DBB2147A; Mon, 19 Nov 2018 16:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542646248; bh=7tFQr3TJ4FC3rjbxzkmMOmdP1t97qDsFZdGjiwXZHEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pUm6BXS0llOLFX3R0mjX2e4CEnvFsJ60pP+nFfZ4qIz/2//TArr237ST87d+468kh XPBr1PxTI2qH6p4jSbhJx7huB3vra9uqF2I0V4qncOfEEPSYZpJIXod3Px4hPXoCfU eLNGkcL33eKBwN65lzLy9a8qvPr4kajdkG20szh0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Daniel Thompson Subject: [PATCH 4.14 093/124] kdb: use correct pointer when btc calls btt Date: Mon, 19 Nov 2018 17:29:07 +0100 Message-Id: <20181119162630.379283144@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162612.951907286@linuxfoundation.org> References: <20181119162612.951907286@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe Leroy commit dded2e159208a9edc21dd5c5f583afa28d378d39 upstream. On a powerpc 8xx, 'btc' fails as follows: Entering kdb (current=0x(ptrval), pid 282) due to Keyboard Entry kdb> btc btc: cpu status: Currently on cpu 0 Available cpus: 0 kdb_getarea: Bad address 0x0 when booting the kernel with 'debug_boot_weak_hash', it fails as well Entering kdb (current=0xba99ad80, pid 284) due to Keyboard Entry kdb> btc btc: cpu status: Currently on cpu 0 Available cpus: 0 kdb_getarea: Bad address 0xba99ad80 On other platforms, Oopses have been observed too, see https://github.com/linuxppc/linux/issues/139 This is due to btc calling 'btt' with %p pointer as an argument. This patch replaces %p by %px to get the real pointer value as expected by 'btt' Fixes: ad67b74d2469 ("printk: hash addresses printed with %p") Cc: Signed-off-by: Christophe Leroy Reviewed-by: Daniel Thompson Signed-off-by: Daniel Thompson Signed-off-by: Greg Kroah-Hartman --- kernel/debug/kdb/kdb_bt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/kernel/debug/kdb/kdb_bt.c +++ b/kernel/debug/kdb/kdb_bt.c @@ -179,14 +179,14 @@ kdb_bt(int argc, const char **argv) kdb_printf("no process for cpu %ld\n", cpu); return 0; } - sprintf(buf, "btt 0x%p\n", KDB_TSK(cpu)); + sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu)); kdb_parse(buf); return 0; } kdb_printf("btc: cpu status: "); kdb_parse("cpu\n"); for_each_online_cpu(cpu) { - sprintf(buf, "btt 0x%p\n", KDB_TSK(cpu)); + sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu)); kdb_parse(buf); touch_nmi_watchdog(); }