From patchwork Sun Aug 11 00:55:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 2842551 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 708F49F271 for ; Sun, 11 Aug 2013 00:55:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A2851201FA for ; Sun, 11 Aug 2013 00:55:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28E71201EC for ; Sun, 11 Aug 2013 00:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751242Ab3HKAzw (ORCPT ); Sat, 10 Aug 2013 20:55:52 -0400 Received: from mga02.intel.com ([134.134.136.20]:56980 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223Ab3HKAzw (ORCPT ); Sat, 10 Aug 2013 20:55:52 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 10 Aug 2013 17:55:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,853,1367996400"; d="scan'208";a="360810769" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.78]) by orsmga001.jf.intel.com with ESMTP; 10 Aug 2013 17:55:51 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 55689301270; Sat, 10 Aug 2013 17:55:51 -0700 (PDT) From: Andi Kleen To: linux-kernel@vger.kernel.org Cc: mmarek@suse.cz, linux-kbuild@vger.kernel.org, Andi Kleen Subject: [PATCH 2/3] Kbuild: Handle longer symbols in kallsyms.c Date: Sat, 10 Aug 2013 17:55:32 -0700 Message-Id: <1376182533-17530-2-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1376182533-17530-1-git-send-email-andi@firstfloor.org> References: <1376182533-17530-1-git-send-email-andi@firstfloor.org> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andi Kleen Also warn for too long symbols Signed-off-by: Andi Kleen --- scripts/kallsyms.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 6940f00..e5af4c5 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -27,7 +27,7 @@ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) #endif -#define KSYM_NAME_LEN 128 +#define KSYM_NAME_LEN 256 struct sym_entry { unsigned long long addr; @@ -118,6 +118,12 @@ static int read_symbol(FILE *in, struct sym_entry *s) fprintf(stderr, "Read error or end of file.\n"); return -1; } + if (strlen(str) > KSYM_NAME_LEN) { + fprintf(stderr, "Symbol %s too long for kallsyms.\n" + "Please increae KSYM_NAME_LEN both in kernel and kallsyms.c", + str); + return -1; + } sym = str; /* skip prefix char */