Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3134263ybt; Mon, 22 Jun 2020 16:09:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz70NsETRA+BaI8oKuzyYq2dbVRnCZviP9OcES+t3hu6DA01/nBl6HLo/PsXDmQEOPkm3xR X-Received: by 2002:a17:906:f6c2:: with SMTP id jo2mr18243002ejb.424.1592867368844; Mon, 22 Jun 2020 16:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592867368; cv=none; d=google.com; s=arc-20160816; b=HWfiaSffphs2SLtXkryGArz+73K/HFeJBvIJ6UBhiuqlbym6qRMBuhQnF9OAzXcETX ExW7cQg1r+8nVyFIV1i/JcSDKqhiA+IxsYE/Aw3LydJnejBFR/BM2ElxJJrurwivJ8NN nP8ujWslt6+RswcTjmgabQdQtpyIhln9Zf1hq42CL9pub9v4rBsTQnTLPP7Jinm8HbQa zRS5hdXQkg1YOa5JBaoV4cD40PX/bcdub1IMYfppNizWyxGtLkspC07BJmJai2QRVqIx LnaQyGV2x7BbMY8bfYlulNQJgv5E/YETZ/bSP8/ZaNnM8Q5XoZbSEQ5muzXxlMkZxaHp aejw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VqNx5+2kiVG9gpFn3910S15vAkYBqDSSedKViD8vzv4=; b=0DfMCYe8KOS8Hl8pn4dmA9xQ0Bfszs0RNnZtwY6yKyq1wBosXGc65R5zK0WdsiJhJF OE9MaJeLg+DgmuCZFl9KJsSYkwjIK+O7DGIBjRSEqUNe0P5dB1ZH3WlVPbmqYjey2qnu YDxTVkzjXP57fJCwQXMHYtvsm3TsWEHInXvt55N6LumFaQcK8y4e6W+3tomaflu7Tk0k a2WotK+1t30PnTiot434yvBb3lOj4ldN/9txDz1PtgHZcF6JzUkbXZX33qe25f56C9Th Q8EhPiXEgR0aIaa2KJxBziJf+encbyVo8UdFz/dZp0LcNG3n5E3yxdJe0FhYVJ6YNAE8 LrHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=PhMXOA29; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si538137ejh.617.2020.06.22.16.09.06; Mon, 22 Jun 2020 16:09:28 -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=@google.com header.s=20161025 header.b=PhMXOA29; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731463AbgFVXEx (ORCPT + 99 others); Mon, 22 Jun 2020 19:04:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731282AbgFVXEw (ORCPT ); Mon, 22 Jun 2020 19:04:52 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F2A1C061573 for ; Mon, 22 Jun 2020 16:04:52 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id bh7so8233950plb.11 for ; Mon, 22 Jun 2020 16:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VqNx5+2kiVG9gpFn3910S15vAkYBqDSSedKViD8vzv4=; b=PhMXOA29UjdzLB+31VLcjALbAfnuSCUduSik9FZHJh5NxaVg0Ze3ovaJuHS6uF5tOP BraZMyN9v0GrizeBmPjb+zv8Akwh25gsoP/yBmHWTJu61OLd+BYRA6M4+11FDOfmpb8R 1oovTnRunpqHNHYygJvCh5+K/rrVDPOIAocDGPEKTab9E8fpHhzHI4F22vH11k2kWiOs QYJUl/zF2QvPUc3JTuCoS4rpwMK9ClrXFVhn37aTvwU/z2mwIqEzeuYKoF/1Sud3lFtS lew7XOE9/h8akBhb6Ty6i9DQ8T04WtAo+VzBd+qGy91923p+SFsaHaUiwiRNYJIDBiKo ddOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VqNx5+2kiVG9gpFn3910S15vAkYBqDSSedKViD8vzv4=; b=q2Lyt2N52KariXaSJ1dyWomN8/nwmh2RH+UYjm8UwdB/0VOa+gvL+1wNb1tRoUws9e 7ZfghI9n8xWGRvklqfmHDvOh8HQv7uGuc6I0NaK9kgfB/E92aHVsqd87ZqJaB52e0L8/ PWg95Qd2t5QBJN3bNUWjMjs9pPdZPmJetSV4evMLdmo8z7bHbYSLh22yeE7igxzl2zNq BGzW2q/PUi5LBMj4TjKU5xHI7hSN5JOaAu9AXKBX4DHVBsMlxoF6VsRjkxmgQ/N186jj 6JSaX9J3nCME0/F21mSVBrpJFL5pVTJy42yFVRtjAfAcQemBGdwuLsQPy3O8msTslTRS Ecmw== X-Gm-Message-State: AOAM530POHvSU6drvHoKV0WHLfiklkkqsQPwQ66he2wvrlaIC3cOQZEp 3tTZTcJK+3tN+q3AMYei1kSCS9TKgsV3zR62t3Id3g== X-Received: by 2002:a17:902:49:: with SMTP id 67mr21218818pla.205.1592867091804; Mon, 22 Jun 2020 16:04:51 -0700 (PDT) MIME-Version: 1.0 References: <20200622205341.2987797-1-keescook@chromium.org> <20200622205341.2987797-2-keescook@chromium.org> <20200622220043.6j3vl6v7udmk2ppp@google.com> <202006221524.CEB86E036B@keescook> <20200622225237.ybol4qmz4mhkmlqc@google.com> <202006221555.45BB6412F@keescook> In-Reply-To: <202006221555.45BB6412F@keescook> From: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Date: Mon, 22 Jun 2020 16:04:40 -0700 Message-ID: Subject: Re: [PATCH v2 1/3] vmlinux.lds.h: Add .gnu.version* to DISCARDS To: Kees Cook Cc: Borislav Petkov , Thomas Gleixner , Ingo Molnar , X86 ML , Arnd Bergmann , Nick Desaulniers , Nathan Chancellor , clang-built-linux , linux-arch@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 22, 2020 at 3:57 PM Kees Cook wrote: > > On Mon, Jun 22, 2020 at 03:52:37PM -0700, Fangrui Song wrote: > > > And it's not in the output: > > > > > > $ readelf -Vs arch/x86/boot/compressed/vmlinux | grep version > > > No version information found in this file. > > > > > > So... for the kernel we need to silence it right now. > > > > Re-link with -M (or -Map file) to check where .gnu.version{,_d,_r} input > > sections come from? > > It's not reporting it correctly: > > .gnu.version_d 0x00000000008966b0 0x0 > .gnu.version_d > 0x00000000008966b0 0x0 arch/x86/boot/compressed/kernel_info.o > > .gnu.version 0x00000000008966b0 0x0 > .gnu.version 0x00000000008966b0 0x0 arch/x86/boot/compressed/kernel_info.o > > .gnu.version_r 0x00000000008966b0 0x0 > .gnu.version_r > 0x00000000008966b0 0x0 arch/x86/boot/compressed/kernel_info.o > > it just reports whatever file is listed on the link command line first. > > > If it is a bug, we should probably figure out which version of binutils > > has fixed the bug. > > I see this with binutils 2.34... > > -- > Kees Cook :( It deserves a binutils bug (https://sourceware.org/bugzilla/enter_bug.cgi?product=binutils ) and a comment.. With the description adjusted to say that this works around a bug Reviewed-by: Fangrui Song