Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1217255ybb; Fri, 3 Apr 2020 21:58:06 -0700 (PDT) X-Google-Smtp-Source: APiQypJdibroRkczkS7Z1MIGiwKbvTUkw44XmtLqYz4yPCwtrKWcWvrp9Hr3AhRWEE+Jcbif/WxX X-Received: by 2002:a05:6830:2428:: with SMTP id k8mr9542798ots.345.1585976286431; Fri, 03 Apr 2020 21:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585976286; cv=none; d=google.com; s=arc-20160816; b=Zr25bOX+X/MoXRNvcdk7T5tvvkK0/dCUqjP1lI9EGvnOZI7UVh+GkBaa06EqqTok7b J9YtIStrbxLVOzLJJ57h7NeIrjdqVzunU9qLOakWj7IpEkHGwT8MIhp3vmDNtn20IwKr QkjO90jc+HBdSftuc6H0uifqsnt+P2+hOawOILbc4kuBphsdqW8jNQkZnSxFs4f9WoJe u6DLK/pZITBaOXa/WyjO4rT/OSOUKN+1lNWrvJus9UKd0cFrObG96FlidawyHPAgNn5x 55m3Rv4H2KlTwUQQ7meDzjB7aM39BJDa08F+KcomHtc5iWA/w8ehjwEPEp6Bi4seFzr0 aVsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=VtnwtgiEvNaRy9Qnd0vNktO6BIuGes3v4sHlRKc0K68=; b=LcfPKm8YCHL7gmb7ltVoCX9wW4Ci0BcuhQ7XhFrrp7cmhmY+UVD1dY2XSMxgb/ciAl GnlCLejqhuMDpUnKWoiZwVHYaskm4Xd2gz4133/VGmSh85fzS5ZsgTvCQaZBARrjOqNC /WkZjPpeEUUu4SkCxWm1e+Gv3lWnwUS2uWW4bqER3lVJ0/ojIQEPOUmFTGO/L3vvodt4 fSd+xjcWSO3E3LZixLrJKoRjAnJBPplM7VzeUHJhRD0B4JgzMtxZ3h+kuz+ABhdrKv7z f8arfth+Xg4YsaeSb46qyP8K8pOXDxsciNQ5H0F+VOLNISDuYZcY3bf4neckKrtdhp3X SxNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CBqdE1a0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6si4923562oto.92.2020.04.03.21.57.12; Fri, 03 Apr 2020 21:58:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CBqdE1a0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725872AbgDDEvz (ORCPT + 99 others); Sat, 4 Apr 2020 00:51:55 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:55420 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgDDEvy (ORCPT ); Sat, 4 Apr 2020 00:51:54 -0400 Received: by mail-pj1-f68.google.com with SMTP id fh8so3997951pjb.5 for ; Fri, 03 Apr 2020 21:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=VtnwtgiEvNaRy9Qnd0vNktO6BIuGes3v4sHlRKc0K68=; b=CBqdE1a0bFq2j4uwHqNbXQoeHno/z1H39dYGxSKI8UfnLBq+xXaKHCrO+ydqqf2xqC orL5mq9dZcF5EvxGKVwk2SWK3neKuXXFsoDtGakEetvK/IhmdSC+yBorFYxU0iNhZMfo e+GGP86L/6gDYPBM5e0gPu4fX0MCZKl6kXKwzsH1TMLAEQSpvp19SazdEQmJ7aakIa34 JVDzIqTCMxHhtGQyUIAreDcIA3WvrCNT02KtFW3A08a+0xCtUSm6ZopDu9DWjL9dwF51 t3vXzDKY79mrKvv4YIEXbgMoBb6lXt8yLPynA8EIp1SzhNRBI+0xYnlR+v53buQ8pysn y3kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=VtnwtgiEvNaRy9Qnd0vNktO6BIuGes3v4sHlRKc0K68=; b=XZuSEH3qHGbJA1JLLZhpJ+lzafCcjuHd7SkqjNyStULsqo+ZVnPXSH1kqtjqsQG0Wa njKwa4q/b9HMnSaSLSba1GY1MBFYtD/IW/R+PBREe/wxqeylc+W+ucq1PtjK5J30hjD3 oBAGykLs5SEkc23BVkrXnVzlLBrRm9f9Hx8ADZqJWlF3VP/pORh1UGTvFWeh3NJbdohZ F72qgcL967ifM//TPmbdr43qNPf8FHjqZAaz2EHazI094SBpID7eP79tWoO6DzVQ9CGF FEeo9BSe6heP3lDRweYLov1uw9MFeYfcxLpd1jiICZ5njWbzJHWSR9Y9KEejqZKSO2CE j7og== X-Gm-Message-State: AGi0PuatBpgUTuya20/f/eOITO1+GoDhPKgX/EQ3I6qS0V28GXoYCXSG nq0smRczq6sAIegGxbk1cfhsgA== X-Received: by 2002:a17:90a:ba93:: with SMTP id t19mr13501086pjr.67.1585975912420; Fri, 03 Apr 2020 21:51:52 -0700 (PDT) Received: from google.com ([2620:15c:2ce:0:9efe:9f1:9267:2b27]) by smtp.gmail.com with ESMTPSA id e126sm6773681pfa.122.2020.04.03.21.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 21:51:51 -0700 (PDT) Date: Fri, 3 Apr 2020 21:51:49 -0700 From: Fangrui Song To: Kees Cook Cc: Nick Desaulniers , Masahiro Yamada , Michal Marek , Thomas Gleixner , Linux Kbuild mailing list , clang-built-linux , Linux Kernel Mailing List , Sandeep Patil Subject: Re: [PATCH] kbuild: mkcompile_h: Include $LD version in /proc/version Message-ID: <20200404045149.ot22fmotljg7aim4@google.com> References: <202004020117.6E434C035@keescook> <202004021129.F688E2D@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <202004021129.F688E2D@keescook> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-04-02, Kees Cook wrote: >On Thu, Apr 02, 2020 at 11:22:02AM -0700, Nick Desaulniers wrote: >> With Kees patch + Masahiro's diff applied: >> $ cat /proc/version >> Linux version 5.6.0-rc7-next-20200330+ (ndesaulniers@> scrubbed>) (clang version 11.0.0 (git@github.com:llvm/llvm-project.git >> 6d71daed03ced011cd25f4e4f4122a368fdc757d), LLD 11.0.0 >> (git@github.com:llvm/llvm-project.git >> 6d71daed03ced011cd25f4e4f4122a368fdc757d)) #167 SMP Thu Apr 2 11:17:36 >> PDT 2020 >> >> Reviewed-by: Nick Desaulniers >> Tested-by: Nick Desaulniers > >Awesome! Thanks for testing. :) > >> We could actually use this in Android for a VTS test I've, uh, been >> meaning to write. Also, LOL at scrubbing the "compatible with" part, >> reminds me of user agent strings in the browser, which are god awful. > >Heh, yeah. That's there because (actually, I think _you_ told me this >when I asked during the ClangBuiltLinux summit) other tools scanned the >LD version string for the binutils-specific bits. For this, since it's >newly added to the kernel /proc/version, nothing is already expecting to >find an LD string, and it looked super weird in there if I left it >as-is. Hence, scrub! > >-Kees Thanks for the patch! This is a great idea. The linker version may be more useful if link-time optimizations or future post link-time optimizations are enabled. The linker will do code generation just like the compiler and there will be lots of variety. The LD version can become more useful in the future. > + LD_VERSION=$($LD -v | head -n1 | sed 's/(compatible with [^)]*)//' \ This User-Agent style hack reminds me of https://reviews.llvm.org/D31199 ... Looks like nobody had posted patch to teach libtool about LLD yet! So, I just posted a patch. It should appear on https://lists.gnu.org/archive/html/libtool-patches/2020-04/index.html in less than 15 minutes. As what Nathan has just said > With this patch + Masahiro's fold in: Reviewed-by: Fangrui Song