Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1160350pxu; Wed, 6 Jan 2021 14:10:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7lko0gPeZqUZDUhPDLM8NI4dSeHfWQjJlEzjJKEKTOlnZv0tCbzYyynFhaVIoShdDl8KF X-Received: by 2002:a05:6402:b4d:: with SMTP id bx13mr5372185edb.93.1609971040040; Wed, 06 Jan 2021 14:10:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609971040; cv=none; d=google.com; s=arc-20160816; b=Y79Ky0uDis29bYd03uwnBQtv43Ae/tc1zbdaD1+0dYCoGA3xyY9u6sAZWIdRjnun4A y/jcfAqPQ4rbTSknPwBpd+T7bT4spqyaBrNTMJraI6w7yt+jls25EgCu2D9CYAHd4VVX yy7dyxyVc6Go7+htAMuPOdmgRzi7r1kHmre85MlFww6B2oFW4awDFl/urt/hJCK7yTkG KU/VDFqdeTikRJMm9F6C7cJkmM2SdtmjcENIOjuHUcywL2uCxPgo0qt7s4EjKsMxyOUX wxQF23AL6iUTgxRMJ2qmlwNyz1xGmSBz/tSpu1jTYtDZH133s6+p/RX2V6xCZzS4QUc3 ar7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=97bTCu9/bzmLzrhctga1J2iFmuyfoogQ7hmoxWlzhpk=; b=GPeuoiq0cad0DhRRW8Mkh0Z7v8OkGpeNz2nJ1i8Mt4mZzTESwPlPWi0+rky8INV2SV 1U2tziDtzqpYUimqrWiajOAVSS4pOXDrbDCR2vsTekt6PimtaBCA6alo1jKQm22+T2sS 9+uq0LKNl1iefGghZyzDzJgRHcFvWulsWL1/KRoiVwV9MZolLhqhRaWCF1W9hUXRwsCl b2WPMntG/TI4NvXPHKNPPpr+1r/0bccrjyaSily9+jmhrwdRYmh3klNF97nU20mYL0Um 4WgmdNRt0MbOJ05XaGrUWmqoMjvz1y4Zm94XXloJmcg7WoZ2hYgCtNiQoAGH0UsbdUnp N0FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MHvyLbjH; 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 l23si1440801edr.325.2021.01.06.14.10.16; Wed, 06 Jan 2021 14:10:40 -0800 (PST) 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=MHvyLbjH; 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 S1727645AbhAFWHu (ORCPT + 99 others); Wed, 6 Jan 2021 17:07:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727150AbhAFWHu (ORCPT ); Wed, 6 Jan 2021 17:07:50 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEACEC061786 for ; Wed, 6 Jan 2021 14:07:09 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id b5so2365357pjl.0 for ; Wed, 06 Jan 2021 14:07:09 -0800 (PST) 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=97bTCu9/bzmLzrhctga1J2iFmuyfoogQ7hmoxWlzhpk=; b=MHvyLbjHzGYY/d2eSM18499bLDNbuoRUCVJKrih26oS3pMLrwHUwEX0vtpb7g+pbVB zxVYPJi9a/XBs5bgqwr3lP2REnJrpTgQHhRWa6vs8S2i61bGw2bEdgjTJoujUMNT99YQ 8KFORDJPn2cFDq9ijNxgxYiL7hwg6YgjTmkLM= 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=97bTCu9/bzmLzrhctga1J2iFmuyfoogQ7hmoxWlzhpk=; b=SFwMwkYTgYYwT2/5qDJhXUg7za/Ih/92P2aX514+qEDJBEX2xlrBAlIQMI9yoQat88 2bLfnsEWErLGIh6fBDhVPbB9VxuL098zomMFbHDm4xztjqpRye7/5ti4ck41Lg42PLIa 3aWha9jd1oMH0a0zcxxRV1zcpfwL9BCjjBP3ZOu7ftAq8SRO3OHRyOMwKH0vcL2Wvl+V Q08oExuSBsk4ge75wrRgE8xMm72NidGfVnGB7dEUDumQdb3pJSg1fTGvddVsNVTKOWv5 tCzlUlq8yxOy5WY/YpnGBhHVCFzzVC7MT3wLAO+BuFHjvAlr4Yjwz1JDSln0XM0Tov1F zj4g== X-Gm-Message-State: AOAM5322esIq6ILXVpLn4MPTQ6A77luCfUKVnc1WuF7oyGn4UFlK6Jrm 8s/8LWSpmkmj7RJMib7css4EOQ== X-Received: by 2002:a17:90a:6fc7:: with SMTP id e65mr6190115pjk.116.1609970829428; Wed, 06 Jan 2021 14:07:09 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id o32sm3821053pgm.10.2021.01.06.14.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jan 2021 14:07:08 -0800 (PST) Date: Wed, 6 Jan 2021 14:07:07 -0800 From: Kees Cook To: Alexander Lobakin Cc: Thomas Bogendoerfer , Nathan Chancellor , Fangrui Song , Jiaxun Yang , Alex Smith , Ralf Baechle , Markos Chandras , linux-mips@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 mips-next 2/4] MIPS: vmlinux.lds.S: add ".gnu.attributes" to DISCARDS Message-ID: <202101061400.8F83981AE@keescook> References: <20210106200713.31840-1-alobakin@pm.me> <20210106200801.31993-1-alobakin@pm.me> <20210106200801.31993-2-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210106200801.31993-2-alobakin@pm.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 06, 2021 at 08:08:19PM +0000, Alexander Lobakin wrote: > Discard GNU attributes at link time as kernel doesn't use it at all. > Solves a dozen of the following ld warnings (one per every file): > > mips-alpine-linux-musl-ld: warning: orphan section `.gnu.attributes' > from `arch/mips/kernel/head.o' being placed in section > `.gnu.attributes' > mips-alpine-linux-musl-ld: warning: orphan section `.gnu.attributes' > from `init/main.o' being placed in section `.gnu.attributes' > > Misc: sort DISCARDS section entries alphabetically. Hmm, I wonder what is causing the appearance of .eh_frame? With help I tracked down all the causes of this on x86, arm, and arm64, so that's why it's not in the asm-generic DISCARDS section. I suspect this could be cleaned up for mips too? Similarly for .gnu.attributes. What is generating that? (Or, more specifically, why is it both being generated AND discarded?) -Kees > > Signed-off-by: Alexander Lobakin > --- > arch/mips/kernel/vmlinux.lds.S | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S > index 83e27a181206..5d6563970ab2 100644 > --- a/arch/mips/kernel/vmlinux.lds.S > +++ b/arch/mips/kernel/vmlinux.lds.S > @@ -221,9 +221,10 @@ SECTIONS > /* ABI crap starts here */ > *(.MIPS.abiflags) > *(.MIPS.options) > + *(.eh_frame) > + *(.gnu.attributes) > *(.options) > *(.pdr) > *(.reginfo) > - *(.eh_frame) > } > } > -- > 2.30.0 > > -- Kees Cook