Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4842830iob; Mon, 9 May 2022 02:59:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnnFpcpqhkkx/fO8fCX3AJ6tS1WIomJNElUMNDfpA3nHBukTiw7ADy8kRoN286qhz2S7kv X-Received: by 2002:a17:903:2091:b0:15c:b49b:664d with SMTP id d17-20020a170903209100b0015cb49b664dmr15646884plc.151.1652090373886; Mon, 09 May 2022 02:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652090373; cv=none; d=google.com; s=arc-20160816; b=GYeuqR/Fa0rq75OXaFCQEHtjPKbiBx9AP9NY7uPbM+J64h23iimSdOkxp6nnMfNBrC q5vyJhoKzqs1SFB8TtbiK1eS4HhZQ91xOXiVITmVysYzrkjsD5n4dpuHejKvmKkW7IA6 TZSsdkxZ0bMhU44TrgePEPgq7VUXFxz9P7rDvGusNhpB1o6lCSO+099onoWqPTb5O/fl KdG3is6e2bJsJxozboOuaQjrkVebn9pvnKI2D8wBl6EAtLSQCxC0LrYuCwkdujB3sFEq U8pj4rjqCrDqEb6b1ldxZoFZ9wEhY0kVKE7AGgrB0p0HgnybkTvVO9jF9WJAPqAhPsw7 lSwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:to:from:date; bh=2fnL4wldoXNrG6WBDtZQlmjHi5Al8+I2mBKJiGpXjto=; b=cXacWLHqYx+Ib4koluvzIpO6QqZL/nnUQW6FJXZYyvLekt+Kbc2HwTCFbVQsEcd7Y3 YwwPYM6U2fD9QX78G6Q+7C1+OqHD57rLdp+yrykUIF5fX7XXLZ3wg+kjrrwnTIe6jFo1 Ut50C94Sk+qjgksjBCsKmbb2kdH/3PgIAXv9i6Amo+B84x1uVVvZQIvPUjNFxIxwsikc 3EGbejscxcqDJb+ZVF+TKF4ah03CsEnCZ8gpcIP7WUs1L+T4453041jEUWQT+WXTTzwV OXZ0dyf4yN30R2hntlIHqWQjbuxe91aV9/Q8pqE2pR2hAHfugD+krOfnBY9U2JGiR/WS CY8w== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p3-20020a17090a2c4300b001dc391fd23csi15827684pjm.134.2022.05.09.02.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:59:33 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 58F1814C77E; Mon, 9 May 2022 02:42:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354236AbiEFJ7p (ORCPT + 99 others); Fri, 6 May 2022 05:59:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236473AbiEFJ7l (ORCPT ); Fri, 6 May 2022 05:59:41 -0400 X-Greylist: delayed 433 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 06 May 2022 02:55:57 PDT Received: from rosa.stappers.it (rosa.stappers.it [77.72.145.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5E3B24754F; Fri, 6 May 2022 02:55:56 -0700 (PDT) Received: by rosa.stappers.it (Postfix, from userid 1000) id 5B06F2014; Fri, 6 May 2022 11:45:36 +0200 (CEST) Date: Fri, 6 May 2022 11:45:36 +0200 From: Geert Stappers To: Miguel Ojeda , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Andrew Morton , Sergey Senozhatsky , Kefeng Wang , Helge Deller , Stephen Boyd , Christophe Leroy , Masahiro Yamada , Nick Desaulniers , Changbin Du , Nathan Chancellor , "Gustavo A. R. Silva" , Andi Kleen , Kees Cook , Adrian Hunter , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, linux-perf-users@vger.kernel.org, rust-for-linux@vger.kernel.org, Alex Gaynor , Wedson Almeida Filho , Gary Guo , Boqun Feng Subject: Re: [PATCH v1 3/3] kallsyms: increase maximum kernel symbol length to 512 Message-ID: <20220506094536.GL1551@rosa.stappers.it> References: <20220505191704.22812-1-ojeda@kernel.org> <20220505191704.22812-4-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220505191704.22812-4-ojeda@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 05, 2022 at 09:16:45PM +0200, Miguel Ojeda wrote: > > generates a symbol of length 96 when using the upcoming v0 mangling scheme: > > _RNvXNtCshGpAVYOtgW1_7example9my_moduleINtB2_13MyGenericTypeNtB2_6MyTypeENtB2_7MyTrait9my_method > > At the moment, Rust symbols may reach up to 300 in length. > Setting 512 as the maximum seems like a reasonable choice to > keep some headroom. > > diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h > index ce1bd2fbf23e..e5ad6e31697d 100644 > --- a/include/linux/kallsyms.h > +++ b/include/linux/kallsyms.h > @@ -15,7 +15,7 @@ > > #include > > -#define KSYM_NAME_LEN 128 > +#define KSYM_NAME_LEN 512 multiplication factor is four > --- a/kernel/livepatch/core.c > +++ b/kernel/livepatch/core.c > @@ -213,7 +213,7 @@ static int klp_resolve_symbols(Elf_Shdr *sechdrs, const char *strtab, > * we use the smallest/strictest upper bound possible (56, based on > * the current definition of MODULE_NAME_LEN) to prevent overflows. > */ > - BUILD_BUG_ON(MODULE_NAME_LEN < 56 || KSYM_NAME_LEN != 128); > + BUILD_BUG_ON(MODULE_NAME_LEN < 56 || KSYM_NAME_LEN != 512); factor four > @@ -227,7 +227,7 @@ static int klp_resolve_symbols(Elf_Shdr *sechdrs, const char *strtab, > > /* Format: .klp.sym.sym_objname.sym_name,sympos */ > cnt = sscanf(strtab + sym->st_name, > - ".klp.sym.%55[^.].%127[^,],%lu", > + ".klp.sym.%55[^.].%511[^,],%lu", 4 * ( 127 + 1 ) = 511 + 1 > --- a/scripts/kallsyms.c > +++ b/scripts/kallsyms.c > @@ -30,10 +30,10 @@ > #define _stringify_1(x) #x > #define _stringify(x) _stringify_1(x) > > -#define KSYM_NAME_LEN 128 > +#define KSYM_NAME_LEN 512 factor four > --- a/tools/include/linux/kallsyms.h > +++ b/tools/include/linux/kallsyms.h > @@ -6,7 +6,7 @@ > #include > #include > > -#define KSYM_NAME_LEN 128 > +#define KSYM_NAME_LEN 512 factor four > --- a/tools/lib/perf/include/perf/event.h > +++ b/tools/lib/perf/include/perf/event.h > @@ -95,7 +95,7 @@ struct perf_record_throttle { > }; > > #ifndef KSYM_NAME_LEN > -#define KSYM_NAME_LEN 256 > +#define KSYM_NAME_LEN 512 Here is the multiplication factor two. > --- a/tools/lib/symbol/kallsyms.h > +++ b/tools/lib/symbol/kallsyms.h > @@ -7,7 +7,7 @@ > #include > > #ifndef KSYM_NAME_LEN > -#define KSYM_NAME_LEN 256 > +#define KSYM_NAME_LEN 512 Another "factor two" It feels good to unify all the KSYM_NAME_LEN to 512. Thing that feels less good is doubling 256 versus quadrupling 128. I felt the need to report that. Feel free to ignore this remark. Groeten Geert Stappers -- Silence is hard to parse