Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3131535ybt; Mon, 22 Jun 2020 16:05:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypbmtmqoOAJNw52Dl+wmqXb27BqNslmSSPZE7OgeiLy5LBGuByhYFR/8kOr13rVzOkP+aJ X-Received: by 2002:aa7:cd6c:: with SMTP id ca12mr19544008edb.36.1592867113665; Mon, 22 Jun 2020 16:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592867113; cv=none; d=google.com; s=arc-20160816; b=BmbKyFWqS4fW2gA0Edw/I04LPGDgjRs6mmM5zovLeBvixjmHtj39unOFVI3U38QouO hRPuBocR1rK5obZi0vhcHEzTMj9t/SLRZMFm0UC5yIMey5NO5Vysc/bYj6kH1meo0DGW l/k8XT24avQaEnbEw1G5jTImHhgIUcxMUaF84JiBGs9pYwYSvFhfd0QW8Uu5zpsQQuZQ DKroDLc6/oKdD0iJet2S32Uccc594TYVO1FEc/YQDx4MBAesqndQoVrPSX3wAYaLiolA kh1DKTqYb04yK3Ob8MYSoGBKiK83RDArLaP0Z/gJBrgoHl/Am4PJbXAzwsHYFJX/kBYG HRlA== 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=83TCNCBjNohNVrqhGduE8K74z3IQ6/Lu6H9fSwHcKBI=; b=DBqXTkPZkErMiBgTVi+UV4iDrHN2DlKbQhasbnQHTBn+k5uMqDfOZL/P4eamRzb/jL qrLHk5NxO10l36s5i5dmCv7YWfukZuJYsB8VZJkmem/FpQY0w/NWOk2MVVkAusQKIfDp Jtl0cazmpN9tjahTrLrexx5bi4HzN3xvXYu6nZyy+cQ+W7AcTdo7iSWBqbPv4B+45aEQ /KUsr29zxpS3QoGhTkq3E3bex3zQCQy8UOmHXxhoIpwwiIc5kNhw48r3Ss2KZDPAOZrf ZEv0xC2tI9l0PXOZ4tVj1zGGC8VeQnO/9nDwrvvQFa6meGoSBn1ohtD/15XFK4iGaMxf yaow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DEgcNUgm; 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 k6si10945057edv.190.2020.06.22.16.04.51; Mon, 22 Jun 2020 16:05:13 -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=DEgcNUgm; 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 S1731343AbgFVXAQ (ORCPT + 99 others); Mon, 22 Jun 2020 19:00:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731175AbgFVXAP (ORCPT ); Mon, 22 Jun 2020 19:00:15 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EF6DC061795 for ; Mon, 22 Jun 2020 16:00:15 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id b5so9098354pfp.9 for ; Mon, 22 Jun 2020 16:00:15 -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=83TCNCBjNohNVrqhGduE8K74z3IQ6/Lu6H9fSwHcKBI=; b=DEgcNUgmnqgavBlvTgADYfLgOafyX/H5FdDRdvi9Bb6S/WBs7kYll9YiPjRSOvgAEG v7bulz7OBSDhmA+jwBGRGVdMGRWVjDRy6+FOm9QURTY20m2IeGFzm5+8yMNEN2Dr6Oa1 ibe8QqZwP9MNkKA71L+uamdauQHqW1Qj57tvg= 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=83TCNCBjNohNVrqhGduE8K74z3IQ6/Lu6H9fSwHcKBI=; b=El77Bk34l+2r4K7MseJxdqtjL1mQ+bWxOlr0vpSKNyz6aHWIKl5vNQ7cFYx3Q/RwtQ CHYYhgedwWsRG1IzjuCB2+CFrlnO/rLhklXYEAFk9mRgEtqucgEnaHchpiC/4+IKXooL zrAUBHJYOEnck5du3H17HMnFgR3zSi8xlrPM1axZicx1P4SDI3rLxEv0ttwhMkqQL2pv gacjaaoCXvOkXdiUIAk1odbMSBMYv0XuPOPeHToayRypmxcYflXib/1Rb0GJVxuSVB7I hYYgp0OK4POsQ+FG2wt0FzF7EWj09Vx6v1AJCF2VaYvXngRsrMAwnzCV/t19zvD/vCP+ tAZw== X-Gm-Message-State: AOAM531aMzyCiyP4EK2Dpuh1eaVRJdxHwAwTpivCSkH1M0k2l8BKYOb5 zrncSzQenlMeYP1KnHG4FlDiXQ== X-Received: by 2002:a63:df56:: with SMTP id h22mr14511327pgj.140.1592866814612; Mon, 22 Jun 2020 16:00:14 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id v7sm14485890pfn.147.2020.06.22.16.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 16:00:13 -0700 (PDT) Date: Mon, 22 Jun 2020 16:00:12 -0700 From: Kees Cook To: Fangrui Song Cc: Borislav Petkov , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Arnd Bergmann , Nick Desaulniers , Nathan Chancellor , clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] x86/boot: Warn on orphan section placement Message-ID: <202006221600.81F5586@keescook> References: <20200622205341.2987797-1-keescook@chromium.org> <20200622205341.2987797-4-keescook@chromium.org> <20200622220628.t5fklwmbtqoird5f@google.com> <202006221543.EA2FCFA2FF@keescook> <20200622224928.o2a7jkq33guxfci4@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200622224928.o2a7jkq33guxfci4@google.com> 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 03:49:28PM -0700, Fangrui Song wrote: > On 2020-06-22, Kees Cook wrote: > > On Mon, Jun 22, 2020 at 03:06:28PM -0700, Fangrui Song wrote: > > > LLD may report warnings for 3 synthetic sections if they are orphans: > > > > > > ld.lld: warning: :(.symtab) is being placed in '.symtab' > > > ld.lld: warning: :(.shstrtab) is being placed in '.shstrtab' > > > ld.lld: warning: :(.strtab) is being placed in '.strtab' > > > > > > Are they described? > > > > Perhaps: > > > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h > > index db600ef218d7..57e9c142e401 100644 > > --- a/include/asm-generic/vmlinux.lds.h > > +++ b/include/asm-generic/vmlinux.lds.h > > @@ -792,6 +792,9 @@ > > .stab.exclstr 0 : { *(.stab.exclstr) } \ > > .stab.index 0 : { *(.stab.index) } \ > > .stab.indexstr 0 : { *(.stab.indexstr) } \ > > + .symtab 0 : { *(.symtab) } \ > > + .strtab 0 : { *(.strtab) } \ > > + .shstrtab 0 : { *(.shstrtab) } \ > > .comment 0 : { *(.comment) } > > > > #ifdef CONFIG_GENERIC_BUG > > This LGTM. Nit: .comment before .symtab is a more common order. Adjusted. > Reviewed-by: Fangrui Song Thanks! -- Kees Cook