From patchwork Wed Apr 3 07:56:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wieczorkiewicz, Pawel" X-Patchwork-Id: 10882997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7434922 for ; Wed, 3 Apr 2019 07:58:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D538F2898B for ; Wed, 3 Apr 2019 07:58:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C935728995; Wed, 3 Apr 2019 07:58:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 73C3B2898B for ; Wed, 3 Apr 2019 07:58:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hBalH-00045E-FD; Wed, 03 Apr 2019 07:56:43 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hBalG-000459-7w for xen-devel@lists.xen.org; Wed, 03 Apr 2019 07:56:42 +0000 X-Inumbo-ID: 03a5a49a-55e6-11e9-bc90-bc764e045a96 Received: from smtp-fw-33001.amazon.com (unknown [207.171.190.10]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 03a5a49a-55e6-11e9-bc90-bc764e045a96; Wed, 03 Apr 2019 07:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1554278200; x=1585814200; h=from:to:cc:subject:date:message-id:mime-version; bh=+kItqRu4WyMXJ2L0+h8dFV9dAyZaJRR+1A9qUbR0esE=; b=Y/AL44YFerYU/jJ5YIw9y3ET5hVkJUYh+3D0OC4LiNLbWj6dowtzjA5J cBcWD0yMVUVHHFMqHvNzjTao05sKhGL7sb2E00rux3k/YOYamdRA2bAJO XbYPA4uThruH1Jq92IF3Wl3gFsbWfS4ocA2JQMj9rgDfHePV2v1N3TzfD 8=; X-IronPort-AV: E=Sophos;i="5.60,303,1549929600"; d="scan'208";a="792282460" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-1a-821c648d.us-east-1.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Apr 2019 07:56:30 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1a-821c648d.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id x337uRUW100877 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 3 Apr 2019 07:56:29 GMT Received: from EX13D05EUB003.ant.amazon.com (10.43.166.253) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 3 Apr 2019 07:56:28 +0000 Received: from EX13MTAUWA001.ant.amazon.com (10.43.160.58) by EX13D05EUB003.ant.amazon.com (10.43.166.253) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 3 Apr 2019 07:56:27 +0000 Received: from dev-dsk-wipawel-1a-0c4e6d58.eu-west-1.amazon.com (10.4.134.33) by mail-relay.amazon.com (10.43.160.118) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 3 Apr 2019 07:56:25 +0000 From: Pawel Wieczorkiewicz To: Date: Wed, 3 Apr 2019 07:56:02 +0000 Message-ID: <20190403075602.43400-1-wipawel@amazon.de> X-Mailer: git-send-email 2.16.5 MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH] xen/tools: Fix symbols segfaults X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com, Pawel Wieczorkiewicz Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The symbols tool is outdated and has a bug in it leading to crashes. The tool is derived from linux kernel where this bug has been already fixed. Original linux kernel commit: e0a04b11e4059cab033469617 scripts/kallsyms.c: fix potential segfault Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Bjoern Doebel Reviewed-by: Norbert Manthey Acked-by: Jan Beulich Signed-off-by: Pawel Wieczorkiewicz > Reviewed-by: Bjoern Doebel > Reviewed-by: Norbert Manthey > Acked-by: Jan Beulich > Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: Bjoern Doebel <doebel@amazon.de>
Reviewed-by: Norbert Manthey <nmanthey@amazon.de>
Acked-by: Jan Beulich <jbeulich@suse.com>
--- xen/tools/symbols.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c index 8c5842d43f..05139d1600 100644 --- a/xen/tools/symbols.c +++ b/xen/tools/symbols.c @@ -525,6 +525,8 @@ static void optimize_result(void) /* find the token with the breates profit value */ best = find_best_token(); + if (token_profit[best] == 0) + break; /* place it in the "best" table */ best_table_len[i] = 2;