Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp74561pxb; Thu, 15 Apr 2021 23:23:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkGeCWgpI2IJvXlL89wWTUUjJGzvOqabcOM2jpJrCQll0efPcABMXzXAzLc1A4TmFRH9al X-Received: by 2002:aa7:de12:: with SMTP id h18mr8241737edv.380.1618554217259; Thu, 15 Apr 2021 23:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618554217; cv=none; d=google.com; s=arc-20160816; b=kognnKmMYm+NZpB+zd3wCIuJof8Qus4mMeDfVgGCp/arOyzeBO/cFNPvCIxc7MGHs3 4w3OzMm/YMGQYiWuc3ItvyP1eqvZqm/4ruOJOu4xXXkp2X3oi2bUnItMWwivNHJHrYnt e9E8jGGriQQJPU4dhwHk30zlvmGjt5Pmxyi1aZ0MyQgDJwlf3jeEl020fOeav4SZEFat Yy2oTWIqvlrFzmStEcpLED0EoVUl5unCvD22zCPps/uRXFVZcKHW/nHTHomF++Un6Dl1 VKx3/QAdejea05AdRW2t6OQlk6pfzQgSI71Mm0HGl3nqkLhD1wIKyfXcVRNg1lYBLiKM uUYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=0ULK0xvK0AaFlmfdN+zJSVpnvXjW9mKLMCPfk6y9Zqk=; b=W4WPMLBhGfxQLpCVTjRsEAwrCAguXK8b9inpAO1LgSRmQxZG501aSJASs2ZMtEmhAa ovalot6MO6+CO+3et3vT4KaeFWqMOW0laTFK8LeVnW4NLKuuRYFEgNl909eqYDy8ZYG6 giexrQ6sJr35WOFCkUCnwdgMjDlao3HIuX12BUA8KHKKV+/LOsXawrV1TFo9IMP5aGVd mgsB3wwSRTSzgopA/5ACcWlz+UcaS76GYiZ2XYjJKuGyKh2WJPCvc4alrsL0ArW4Kg7+ pL4m1aqP1wuokWhlJcxT7zd9P+FoMBClvGLaWQHGp30dEVIiGdH1FSsc9W5ewaMS5Z1s XFUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b=L2OY2xrZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q11si4119122edd.16.2021.04.15.23.23.13; Thu, 15 Apr 2021 23:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b=L2OY2xrZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238397AbhDPGT6 (ORCPT + 99 others); Fri, 16 Apr 2021 02:19:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234010AbhDPGT4 (ORCPT ); Fri, 16 Apr 2021 02:19:56 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 023D4C06175F for ; Thu, 15 Apr 2021 23:19:29 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id p16so9457920plf.12 for ; Thu, 15 Apr 2021 23:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=0ULK0xvK0AaFlmfdN+zJSVpnvXjW9mKLMCPfk6y9Zqk=; b=L2OY2xrZoPg+ieFLphuZXE6ah4Tib0x7joZuFxOKOvs9qtSslCdV+QMWs13wJwQ1FG Oji259pHpJ2SWk4UC73GJMvYuGN2d0C5fOXxia/Ip7UPm15DOCNwFS2Ju8Wph7l1Ay2c UI8P80yqJr9tq5DwToPtYo3557gcpbOAuRMQ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=0ULK0xvK0AaFlmfdN+zJSVpnvXjW9mKLMCPfk6y9Zqk=; b=mL9Ga0uCHtt88NRQ/QjwffLOCakkOdhjSuGw2zpRwKC2jC/ynUT5Ivsl+qsJ/iZzYC Nr2PF11v8PW3tckK/sCvw0KKB0A6vrOZQkpE25IQwQZEt1Od+Wwa4KtfPRG3zOGAfiJ/ cRxVTLjMd2i5Aydmi6TRDf3dTlNm4B1pnEP9HkI9IPsNT0UxPZgnewjXb65q/1dKbAf1 wMi1F+DvzQOQ11uweT/plUPqNUkrUpU9Lbb5JHZlMlmhqPXlm2R5fYSQzCP/AT+YimDE cicD7uceYcYVcGSvdYHtQwr0lIDJkY0RSVcKrLYEFIIueIGn3mtD/kH9VxDXcEYotKYS iyJQ== X-Gm-Message-State: AOAM531QWNLnYBm+5vjZgcSuJ0NpVAvELt8bKBPLQMnRLdtSFAIbhkLi TveY5SeSovpiyrZP6Ob6zPdn2oqgnFEUCZ9i X-Received: by 2002:a17:902:d2c9:b029:e9:67f7:9844 with SMTP id n9-20020a170902d2c9b02900e967f79844mr7778864plc.66.1618553969299; Thu, 15 Apr 2021 23:19:29 -0700 (PDT) Received: from localhost (2001-44b8-111e-5c00-09c3-a49e-2955-78c6.static.ipv6.internode.on.net. [2001:44b8:111e:5c00:9c3:a49e:2955:78c6]) by smtp.gmail.com with ESMTPSA id l3sm4151589pju.44.2021.04.15.23.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 23:19:28 -0700 (PDT) From: Daniel Axtens To: =?utf-8?B?6Z+p5aSn6bmPKEhhbiBEYXBlbmcp?= , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "x86\@kernel.org" , "H. Peter Anvin" , Masahiro Yamada , Michal Marek , Mike Rapoport , Pekka Enberg , Andrew Morton , Arseny Solokha , =?utf-8?B?6Z+p5aSn6bmPKEhhbiBEYXBlbmcp?= , Arvind Sankar , Kees Cook , Joerg Roedel , Christian Brauner , Kirill Tkhai , "linuxppc-dev\@lists.ozlabs.org" , "linux-kernel\@vger.kernel.org" , "linux-s390\@vger.kernel.org" , "linux-kbuild\@vger.kernel.org" Cc: =?utf-8?B?6ZmI5a6J5bqGKEFucWluZyk=?= Subject: Re: [PATCH] symbol : Make the size of the compile-related array fixed In-Reply-To: References: Date: Fri, 16 Apr 2021 16:19:24 +1000 Message-ID: <87h7k6g39v.fsf@linkitivity.dja.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thanks for your contribution to the kernel! I notice that your patch is sumbitted as an attachment. In future, please could you submit your patch inline, rather than as an attachment? See https://www.kernel.org/doc/html/v4.15/process/5.Posting.html I'd recommend you use git send-email if possible: see e.g. https://www.kernel.org/doc/html/v4.15/process/email-clients.html > Subject: [PATCH] symbol : Make the size of the compile-related array fixed > > For the same code, the machine's user name, hostname, or compilation time > may cause the kernel symbol address to be inconsistent, which is not > friendly to some symbol-dependent software, such as Crash. If I understand correctly, this patch makes it easier to recompile the kernel from the same source but at a different time or on a different machine or with a different user, but still get the same symbols. Is that right? I wonder if there are other reproducible build techniques that might be simpler to apply? There is a kernel documentation page at https://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html which gives exisiting techniques to override the date, user and host. Would they be sufficient to address your use case? Kind regards, Daniel > > Signed-off-by: Han Dapeng > --- > arch/powerpc/mm/nohash/kaslr_booke.c | 2 +- > arch/s390/boot/version.c | 2 +- > arch/x86/boot/compressed/kaslr.c | 2 +- > arch/x86/boot/version.c | 2 +- > init/version.c | 4 ++-- > scripts/mkcompile_h | 2 ++ > 6 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/arch/powerpc/mm/nohash/kaslr_booke.c b/arch/powerpc/mm/nohash/kaslr_booke.c > index 4c74e8a5482b..494ef408e60c 100644 > --- a/arch/powerpc/mm/nohash/kaslr_booke.c > +++ b/arch/powerpc/mm/nohash/kaslr_booke.c > @@ -37,7 +37,7 @@ struct regions { > }; > > /* Simplified build-specific string for starting entropy. */ > -static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@" > +static const char build_str[COMPILE_STR_MAX] = UTS_RELEASE " (" LINUX_COMPILE_BY "@" > LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION; > > struct regions __initdata regions; > diff --git a/arch/s390/boot/version.c b/arch/s390/boot/version.c > index d32e58bdda6a..627416a27d74 100644 > --- a/arch/s390/boot/version.c > +++ b/arch/s390/boot/version.c > @@ -3,5 +3,5 @@ > #include > #include "boot.h" > > -const char kernel_version[] = UTS_RELEASE > +const char kernel_version[COMPILE_STR_MAX] = UTS_RELEASE > " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") " UTS_VERSION; > diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c > index b92fffbe761f..7b72b518a4c8 100644 > --- a/arch/x86/boot/compressed/kaslr.c > +++ b/arch/x86/boot/compressed/kaslr.c > @@ -43,7 +43,7 @@ > extern unsigned long get_cmd_line_ptr(void); > > /* Simplified build-specific string for starting entropy. */ > -static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@" > +static const char build_str[COMPILE_STR_MAX] = UTS_RELEASE " (" LINUX_COMPILE_BY "@" > LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION; > > static unsigned long rotate_xor(unsigned long hash, const void *area, > diff --git a/arch/x86/boot/version.c b/arch/x86/boot/version.c > index a1aaaf6c06a6..08feaa2d7a10 100644 > --- a/arch/x86/boot/version.c > +++ b/arch/x86/boot/version.c > @@ -14,6 +14,6 @@ > #include > #include > > -const char kernel_version[] = > +const char kernel_version[COMPILE_STR_MAX] = > UTS_RELEASE " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") " > UTS_VERSION; > diff --git a/init/version.c b/init/version.c > index 92afc782b043..adfc9e91b56b 100644 > --- a/init/version.c > +++ b/init/version.c > @@ -35,11 +35,11 @@ struct uts_namespace init_uts_ns = { > EXPORT_SYMBOL_GPL(init_uts_ns); > > /* FIXED STRINGS! Don't touch! */ > -const char linux_banner[] = > +const char linux_banner[COMPILE_STR_MAX] = > "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" > LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n"; > > -const char linux_proc_banner[] = > +const char linux_proc_banner[COMPILE_STR_MAX] = > "%s version %s" > " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")" > " (" LINUX_COMPILER ") %s\n"; > diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h > index 4ae735039daf..02b9d9d54da9 100755 > --- a/scripts/mkcompile_h > +++ b/scripts/mkcompile_h > @@ -65,6 +65,8 @@ UTS_VERSION="$(echo $UTS_VERSION $CONFIG_FLAGS $TIMESTAMP | cut -b -$UTS_LEN)" > LD_VERSION=$($LD -v | head -n1 | sed 's/(compatible with [^)]*)//' \ > | sed 's/[[:space:]]*$//') > printf '#define LINUX_COMPILER "%s"\n' "$CC_VERSION, $LD_VERSION" > + > + echo \#define COMPILE_STR_MAX 512 > } > .tmpcompile > > # Only replace the real compile.h if the new one is different, > -- > 2.27.0