Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3152518ybt; Mon, 22 Jun 2020 16:44:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9r1bXpeRBVb+AML/fYpm+ISOv1U/Nhm/cqCz9uRjaJZlP3KnDhBaJkLb4kDbBJ0aT9Uyk X-Received: by 2002:a17:907:435f:: with SMTP id oc23mr18337307ejb.426.1592869441296; Mon, 22 Jun 2020 16:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592869441; cv=none; d=google.com; s=arc-20160816; b=MjbOLKbVo6hHQr0p2NO3GhGz1e4yZ/fqQyenhshDVw4fbEFE07NfXL6CH0ja+7zMoK qYhA7B0dXn6TT4n5pV8xntMbKMWC9p4J2LzChmTiTLofHKy8OCEgiZoKH31glCgN5z8X IVQUJpmjkHUZw9870xfrtwYkYugSvt7HXEAw0OnBR/fo80fdLTflAfvO/VS7toAU57jY I+N1G8fWTF6oNvOA4kHpeMisdJYJ1EAowL8oUttaAEWXc3Sa5ZLAaQCxMcky6jU07msl CwjN2UILrVG+yVbzJ9q64lZ4NWULMUM8iM8568/LuUhyp+3RCnqLS1aaBmdYF9+5BT+C Vwqg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UWqQV2fZB9OmDJeh5A7wKzCKjHubm13ivYyuz+dxo9g=; b=j/3P+A8zEo3KYF1SSibpPMAyjBKXZrfMsEytYWqedv6hx2WvjyW1WzhE61AlAldmJM TTLJMWLOmkzvRhiSusZ9/C/R5GMvMjAxoP/S0xEkuofHU1q1DqmqK9s3Lva4pj9hVn+p i9cHiGjNjR5HTNAvrlt8oHhCM/p6yNc8JhNP8Th7/FhU4wPeHuJVxD1fqz0Sl3+CoFHi GJaFyUMbB0q0xzAnnDpuqVQ/tjtgX/FjGVv9YOR1Gg+URzVj6xouBKDzVvDuyWi/qKbX zrTaRphz0ESsHmkqcjZsijmc6rlsmP7rZW9gBJx+79HFIp2pEhQuW4c+NadHQw6cHfE3 wVlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bUbfuxxz; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gt5si3596624ejb.679.2020.06.22.16.43.38; Mon, 22 Jun 2020 16:44:01 -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=@chromium.org header.s=google header.b=bUbfuxxz; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730227AbgFVXaV (ORCPT + 99 others); Mon, 22 Jun 2020 19:30:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728131AbgFVXaV (ORCPT ); Mon, 22 Jun 2020 19:30:21 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 021CAC061573 for ; Mon, 22 Jun 2020 16:30:21 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id e18so8981653pgn.7 for ; Mon, 22 Jun 2020 16:30:20 -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:content-transfer-encoding:in-reply-to; bh=UWqQV2fZB9OmDJeh5A7wKzCKjHubm13ivYyuz+dxo9g=; b=bUbfuxxz8CX/dO63xH28vPKUiPOsVTJi9AgkinEsU/PHv9FcsY3GO+vCXKz6K7ZbcH K17+Z5IlfGvcQ7NoKcWU37Zv59d5kOdufCLXPoi2hdIPl8dViI5OgYVS5wGxiWhCEutS yEuRbcSn+crkX1SvyLPKtSWr1vMP8MCwwci0Y= 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:content-transfer-encoding :in-reply-to; bh=UWqQV2fZB9OmDJeh5A7wKzCKjHubm13ivYyuz+dxo9g=; b=ecg4HWfuY6ZNeSkjYaFFQHSNsmv+IVS4Yn/hwpfbzdNtIWDKW2aHyNDmm/g/mySssN 7wOVKw3Lw6gku32rEwUlf2FtGT5i3TBUfMadM8UmAUoAlc95CtTtlUfSLCzD09tPN9vW VlpBrC+3TcMS1zhjU4xiHS4+dno3I8yulo38OB6bv+577OdqKSktiSwYI0mPoyIYf6fL gu6s61qGbt5NEVDalrooygRW1MNege3pVhS6bv1A5bNmquCREfTrRWCwjfgmYsFPLUkq zUnXIiJvyTBJ9Rm5SvcTdJ9zwIdYcrguYq8wPB1lvxdjUXOYyU9HZ6Hsu76o5F3vVayC TloA== X-Gm-Message-State: AOAM531BiZx5I6cfXFtsKjF8WB9b+5HoSKG1wv5xMr2LJADlWK150eM1 jIltee90V7I1cUbuSDsoi1VQYg== X-Received: by 2002:a05:6a00:801:: with SMTP id m1mr22967569pfk.200.1592868620568; Mon, 22 Jun 2020 16:30:20 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b5sm14968992pfg.191.2020.06.22.16.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 16:30:19 -0700 (PDT) Date: Mon, 22 Jun 2020 16:30:18 -0700 From: Kees Cook To: =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Cc: Borislav Petkov , Thomas Gleixner , Ingo Molnar , X86 ML , Arnd Bergmann , Nick Desaulniers , Nathan Chancellor , clang-built-linux , linux-arch@vger.kernel.org, LKML Subject: Re: [PATCH v2 1/3] vmlinux.lds.h: Add .gnu.version* to DISCARDS Message-ID: <202006221629.5C8CF8AE2@keescook> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 04:04:40PM -0700, Fāng-ruì Sòng wrote: > 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.. https://sourceware.org/bugzilla/show_bug.cgi?id=26153 > With the description adjusted to say that this works around a bug > > Reviewed-by: Fangrui Song Adjusted, and thanks! -- Kees Cook