Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2750262imj; Mon, 11 Feb 2019 07:57:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IbK8Y5dJwwj14tbMxVGv7TC83nplTT1LLP2HEaLmGrnZIe6EKIth1GZneIwioKQgN5xY6SN X-Received: by 2002:a17:902:6b8a:: with SMTP id p10mr21003518plk.109.1549900629078; Mon, 11 Feb 2019 07:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900629; cv=none; d=google.com; s=arc-20160816; b=hcgbOwN4cltH9bqv/l8sNPU5WnyXHDcWEyB+oJqxLdtz+sDOGKkmkG+Z3XESAqkMLW 10PWwD3czOWKlGxHLJ+5zXduP3KIlg0F2neUjKM4OpTZ3VaD7ZCYYPhXrK7+H41PSzlU x90y0yGpdBd09qsNyMpAs2UubN2aErzBHxIrjOHHQfzl0U87aB9ROHSXdvxa/3Exo9VX EJ1AlM0zGwTul61eOhTb3baIGHcJhaBi1MoR/L142f0Sgy5UqMuzoecjaqQ1iLKMsA63 1xYjUsEYXZeQuV7Dqx415tzfCKflUrCPw5J6g5O8T6un7wcod89MaXbMFevla94dFcFN QJQA== 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=R8Ubs8L/PBMLfJlaluT3g1i+Q4qcky08Zc+rsBC131c=; b=cs+/j0yXavmAbc2ePBUws61R7CMT1jVVOwP9slkGBLXYbfx/xuwpKfi1OAAlgJTy4m FG5dzrc9P0kas04llyfJdMukOkUTW1WZzlJz79Sxr2jZxzTFB3DTsOFMfpFa5MJWbqaH 3pQR1sWW+RlGmzcqFH/+PtgyvIL04kS+Z0GqNfomtXwd48r3usOtXbX8pb4iijn9J7dN Avj7dleCEdzAOTRMaVCF4DVzfGB+zdm2nXxRXR7TvuV4fMyixGGAsZCa2DbQ/mX0lYKk qx2hneiHQKrPKSlHrEM99rHeKKlBQg7EcV6UYPQ2BT7bCCTWNmN5cHCACClmfL4a3B18 1b+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gsGU6hCp; 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 s7si9964762plq.237.2019.02.11.07.56.53; Mon, 11 Feb 2019 07:57:09 -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=gsGU6hCp; 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 S1730454AbfBKP4A (ORCPT + 99 others); Mon, 11 Feb 2019 10:56:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:43202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730886AbfBKOer (ORCPT ); Mon, 11 Feb 2019 09:34:47 -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 2B069218A3; Mon, 11 Feb 2019 14:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895686; bh=M+uSq+5EYsh9oTZY9mjAhlBQD6AXtCGGk23q5job2Uk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gsGU6hCpoud6uE9//v3LgZXwRLdLgMfsGZukG1Qj4/uwPwAe6m8//a9kVj1l6cKkM P5z8W5FAHH0x+LsgIGZ+UC+/gKz0AjU8P3E2aycOn1RDeHo1ql4d5mZyDe9q/gSGIA EF2TQWZBMljuETCn+m7MuKC6xcN0Pgt5Mx3MG57A= 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.20 289/352] scripts/gdb: fix lx-version string output Date: Mon, 11 Feb 2019 15:18:36 +0100 Message-Id: <20190211141905.290648339@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@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.20-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