Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3436350ybb; Mon, 6 Apr 2020 08:54:47 -0700 (PDT) X-Google-Smtp-Source: APiQypLQ7AHKnkap9y9kDDzd1IhXjdDf80RKKNejHIt3Zs4ZTJpvJUuCdrBgyBrhQx4zqTKnnFfX X-Received: by 2002:a9d:69ca:: with SMTP id v10mr17264058oto.64.1586188487016; Mon, 06 Apr 2020 08:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586188487; cv=none; d=google.com; s=arc-20160816; b=zeTpGna/9Pkl27dXQCnI69zvDbpCKxd+WXT7GwPmh3uqhly284NYrQwbxt63K0FTrX 2ncFHfW7vvstdBCzyEGdz2d0GcRX8f1Apj2PklDbjHMyddj10s8yBtmOOV62fNth2Xr8 q0FcpT3Zu0KlHk63EwTtJDVxFnjgk+Si/jLYOJ7pauBoR2CHNzRlSFAbzPSy5erE+FmS eZJdWQyC3w5lFSJI8g+TSTfjUV9OKUBs5xbtDOZD3nQmepFPX3+DeMyrWUC9n3H2fiHE hM/70EdnQsUooME1JGu+54i97WIxr6hM0DD/YGRGtxFcBnsatRIL+HhJCF70Xftd8R9Z QxHw== 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=wcnhRTJrKqZe9cHSmG/x1YIdkcTsb9+hzvjah1m+gLU=; b=Nbu39VBcHtTOMEXvBnL5t5+Jb+xRFoosZg72+5RoS2x+YMnocqebIviBx73p+Lvul8 1g7N3kyS4obHbL+FVch7UlrW9QR2glf0TkiCRBIsiwQIoGZlXYfInLFJ6dAxLoF1pdps gpHSpUuDPbnvr1rnrnpCS8n6XIuXEO6Q5WkhVlFybo+T4k03Ln8wbEtXeGOUhvUYJhP4 JlX/v3XnDSxuvMvCqbRTZ4oosPG3OEEo4HabAkw1SPYvlp0a9POzaC95F2sHKk1/2caO XlYHZb8aQYWXrsU7aT3BZ9xhkFJPQNjaYrA1BIsxDy0KRchge7uV0eThRejqawyRT0+M nvyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QrYTLNTc; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k62si7489229oif.247.2020.04.06.08.54.33; Mon, 06 Apr 2020 08:54:46 -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=@chromium.org header.s=google header.b=QrYTLNTc; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729106AbgDFPxj (ORCPT + 99 others); Mon, 6 Apr 2020 11:53:39 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:42695 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729076AbgDFPxh (ORCPT ); Mon, 6 Apr 2020 11:53:37 -0400 Received: by mail-pl1-f193.google.com with SMTP id e1so6069682plt.9 for ; Mon, 06 Apr 2020 08:53:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wcnhRTJrKqZe9cHSmG/x1YIdkcTsb9+hzvjah1m+gLU=; b=QrYTLNTcoBTCrSMVW19VcWv0ByKz6+H/37bqjQyrTg4kesqGVzq2Wgfz73C4lswLje dxDZgzi0QyM7rWOy5lpHTOla3P7NFlogJUYlOoFpNTtzBjXYaeEkDoiqoWeA1Phowqys EamnTgsa7EEPlDYtuUdxGe+9I1orrycGdTHEo= 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=wcnhRTJrKqZe9cHSmG/x1YIdkcTsb9+hzvjah1m+gLU=; b=Dg4JzizCCBReeg0oFHBox9BtEF+k0EpkwHCooub4H4AvZ7WqY6QbyT6A42TcbmrVVS 4O5/8ig4RnnHQneGuEWWLJQqmQ+POOivaeY0NJgpbN2ikYtLj/TnZCOJHwSqsPXgc0KQ vhVg3u3tSTQk1UuormNQzYBabCeHMbfAjey+qs6WQ+5lyAVyZf56GUlz0pmVDaHfma79 YMRwEpxrPZw8doRej9eMZgB85CnP8EptV/RAIQA5UHuLokKEKn/qs0PR25qiglwl62BL agDck7e5HmkKg+9uqO4sQccmrhiHNtz1K8HtB9fAiG+XG4gW0f0j9G8nvNv2YIDE+IP9 15JQ== X-Gm-Message-State: AGi0Pubn4c+EMjzraR28Mp4mkjcsthbozgqhB/GOaCWJ+LEHhccOlxSN eF8f0licX/j8pzicklFh6pF8Kg== X-Received: by 2002:a17:90a:2347:: with SMTP id f65mr30129pje.105.1586188416932; Mon, 06 Apr 2020 08:53:36 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t188sm11935793pfb.102.2020.04.06.08.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 08:53:35 -0700 (PDT) Date: Mon, 6 Apr 2020 08:53:35 -0700 From: Kees Cook To: Sedat Dilek Cc: Masahiro Yamada , Michal Marek , Thomas Gleixner , Linux Kbuild mailing list , Clang-Built-Linux ML , Linux Kernel Mailing List Subject: Re: [PATCH] kbuild: mkcompile_h: Include $LD version in /proc/version Message-ID: <202004060851.CCB538AD1@keescook> References: <202004020117.6E434C035@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 06, 2020 at 12:35:35PM +0200, Sedat Dilek wrote: > On Sun, Apr 5, 2020 at 3:56 PM Masahiro Yamada wrote: > > > > On Sun, Apr 5, 2020 at 8:23 PM Sedat Dilek wrote: > > > > > > On Thu, Apr 2, 2020 at 4:24 PM Sedat Dilek wrote: > > > > > > > > On Thu, Apr 2, 2020 at 10:18 AM Kees Cook wrote: > > > > > > > > > > When doing Clang builds of the kernel, it is possible to link with > > > > > either ld.bfd (binutils) or ld.lld (LLVM), but it is not possible to > > > > > discover this from a running kernel. Add the "$LD -v" output to > > > > > /proc/version. > > > > > > > > > > Signed-off-by: Kees Cook > > > > > > > > > > Please feel free and add: > > > > > > Reviewed-by: Sedat Dilek > > > Tested-by: Sedat Dilek > > > > > > Thanks. > > > > I collected all Reviewed-by and Tested-by. > > > > How to test scripts/mkcompile_h? There's probably a better way, but I do: $ rm include/generated/compile.h init/version.o $ make init/version.o $ cat include/generated/compile.h -Kees > > I did: > > $ cd /path/to/linux > > $ head -10 scripts/mkcompile_h > #!/bin/sh > # SPDX-License-Identifier: GPL-2.0 > > TARGET=$1 > ARCH=$2 > SMP=$3 > PREEMPT=$4 > PREEMPT_RT=$5 > CC=$6 > LD=$7 > > $ scripts/mkcompile_h include/generated/compile.h x86_64 SMP "" "" > clang-10 ld.lld-10 > UPD include/generated/compile.h > > $ cat include/generated/compile.h > /* This file is auto generated, version 1 */ > /* SMP */ > #define UTS_MACHINE "x86_64" > #define UTS_VERSION "#1 SMP Mon Apr 6 12:29:53 CEST 2020" > #define LINUX_COMPILE_BY "dileks" > #define LINUX_COMPILE_HOST "iniza" > #define LINUX_COMPILER "clang version 10.0.0-2, LLD 10.0.0" > > This is with clang-10 and ld.lld-10 from Debian/unstable: > > $ clang-10 -v > clang version 10.0.0-2 > Target: x86_64-pc-linux-gnu > Thread model: posix > InstalledDir: /usr/bin > Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10 > Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8 > Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9 > Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10 > Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8 > Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9 > Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10 > Candidate multilib: .;@m64 > Candidate multilib: 32;@m32 > Candidate multilib: x32;@mx32 > Selected multilib: .;@m64 > > $ ld.lld-10 -v > LLD 10.0.0 (compatible with GNU linkers) > > Thanks. > > - sed@ - -- Kees Cook