From patchwork Tue Oct 22 15:46:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 3083631 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CE752BF924 for ; Tue, 22 Oct 2013 15:47:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 524B920218 for ; Tue, 22 Oct 2013 15:47:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C3642021A for ; Tue, 22 Oct 2013 15:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753557Ab3JVPrI (ORCPT ); Tue, 22 Oct 2013 11:47:08 -0400 Received: from mga03.intel.com ([143.182.124.21]:12944 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753054Ab3JVPq2 (ORCPT ); Tue, 22 Oct 2013 11:46:28 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 22 Oct 2013 08:46:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,535,1378882800"; d="scan'208";a="311149816" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.86]) by AZSMGA002.ch.intel.com with ESMTP; 22 Oct 2013 08:46:26 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 610A7300D35; Tue, 22 Oct 2013 08:46:26 -0700 (PDT) From: Andi Kleen To: mmarek@suse.cz Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH 2/3] Kbuild: Handle longer symbols in kallsyms.c Date: Tue, 22 Oct 2013 08:46:22 -0700 Message-Id: <1382456783-22826-3-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1382456783-22826-1-git-send-email-andi@firstfloor.org> References: <1382456783-22826-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=-7.3 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..46264c7 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 increase KSYM_NAME_LEN both in kernel and kallsyms.c", + str); + return -1; + } sym = str; /* skip prefix char */