Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2716713imj; Mon, 11 Feb 2019 07:25:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IaOZF09ZCrgZaZrk8eNRENnVHlps23Qcf6V7vgjODRdJ65wOG/W+UJCmB6Ex0sV6ugUIZPK X-Received: by 2002:a17:902:104:: with SMTP id 4mr37905377plb.62.1549898752486; Mon, 11 Feb 2019 07:25:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549898752; cv=none; d=google.com; s=arc-20160816; b=SCdK6ODhMt4qSC8qN8s0//3fFduZrYwz5LJGFROVe5TG2yFYcbeNYdmwa387JZSnKZ es7Dss4ysugkVG+tEUqRuW/QNzN3Y+Cu5ZI34bnTy98KENd8boY85lTdsPKoAqxCQPGu gWHOIyJVOOP/yJSfXtRJINzGkXbdl4Mh1bWF70mriCh2Dc5VMD2zOKnPrqU+b7HNwLMl 3fZIo8gBmOCRITqodS834qVzPgsstEnHUAV37FC9IafktnrH/YP3SNG7dsdiD7A6JwSH fJHMbU7JOW8DhaU91gkJzaE+ZH4xcFmYOmPDGHK97kjOxTbm1vTb1S2rL73BcHNq2iDz 1tnA== 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=1t6IVe5iZbWfPR5+qElebFoyvpvlhrcMOCzN2C/EMuE=; b=DfyyVyAj5j3zba2OSq/nAcE13naQWBvLbDqBGVf+Qnh4OULoYBaYAdtSKZY4QTsVFp mXjGhM7/CBeEAcuc2Zg+IRv0gccQrAFtlT+kUY/mtmrjXV4I5njd82zkUHn+4QjAiC2G HtrO0cNJJoXqi09ViWt+b1ynmHU4/IcJC1bER3BMRErG3K8+YR56bKSYHGIKpHrNWOAA omE/WqRiQqiB9QPiZgK04dTShvOREilIDmNK9Au4eEAgTTzy+1hEj5uGNsBszqc+RXLp h9KMaJuHBdxb+ao1nmENKvt3jM064A4kShQTgLB18eke9PjVwFgXdMFRuNQfgyPaDw3H AKtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QoQwpX3s; 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 b15si11062705plm.431.2019.02.11.07.25.36; Mon, 11 Feb 2019 07:25:52 -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=QoQwpX3s; 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 S2390331AbfBKPCF (ORCPT + 99 others); Mon, 11 Feb 2019 10:02:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:50214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387943AbfBKPCC (ORCPT ); Mon, 11 Feb 2019 10:02:02 -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 9FE7E222A7; Mon, 11 Feb 2019 15:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897322; bh=LZGIfELqOQFeE763S90ATjwGHwXA6wEja8pBWX9ThrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QoQwpX3slCCI3Z/g039mfcqw3HFvF9coimGaO+FD3PkrQ7MYyVjiOBR7GNTGiFsHK MnRxFU7AxM6A7nFeO2K9T98T1n5AoYcc/vqxl6n4OJNmYX+n2W0vY8EDWhIjexwD3q AhdJ1ZNTVecKbkP8y4k7jZVdX00evXwDO6pvFAOw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Du Changbin , Kieran Bingham , Jan Kiszka , Jason Wessel , Daniel Thompson , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.14 164/205] scripts/gdb: fix lx-version string output Date: Mon, 11 Feb 2019 15:19:22 +0100 Message-Id: <20190211141839.085022574@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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. ------------------ [ Upstream commit b058809bfc8faeb7b7cae047666e23375a060059 ] A bug is present in GDB which causes early string termination when parsing variables. This has been reported [0], but we should ensure that we can support at least basic printing of the core kernel strings. For current gdb version (has been tested with 7.3 and 8.1), 'lx-version' only prints one character. (gdb) lx-version L(gdb) This can be fixed by casting 'linux_banner' as (char *). (gdb) lx-version Linux version 4.19.0-rc1+ (changbin@acer) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #21 SMP Sat Sep 1 21:43:30 CST 2018 [0] https://sourceware.org/bugzilla/show_bug.cgi?id=20077 [kbingham@kernel.org: add detail to commit message] Link: http://lkml.kernel.org/r/20181111162035.8356-1-kieran.bingham@ideasonboard.com Fixes: 2d061d999424 ("scripts/gdb: add version command") Signed-off-by: Du Changbin Signed-off-by: Kieran Bingham Acked-by: Jan Kiszka Cc: Jan Kiszka Cc: Jason Wessel Cc: Daniel Thompson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- scripts/gdb/linux/proc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gdb/linux/proc.py b/scripts/gdb/linux/proc.py index 086d27223c0c..0aebd7565b03 100644 --- a/scripts/gdb/linux/proc.py +++ b/scripts/gdb/linux/proc.py @@ -41,7 +41,7 @@ class LxVersion(gdb.Command): def invoke(self, arg, from_tty): # linux_banner should contain a newline - gdb.write(gdb.parse_and_eval("linux_banner").string()) + gdb.write(gdb.parse_and_eval("(char *)linux_banner").string()) LxVersion() -- 2.19.1