Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4210191pxu; Wed, 9 Dec 2020 11:00:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5J+xpX/4Ayl01vUjyj27T5GhgQ+kUils11RPNn/TfDwlgvwBr38An1kKlMtXC74GnDrIH X-Received: by 2002:a17:907:961b:: with SMTP id gb27mr3210461ejc.313.1607540459172; Wed, 09 Dec 2020 11:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607540459; cv=none; d=google.com; s=arc-20160816; b=XHW+dLvogFgvxYhUgMb8yuCIKLKOdZuMZkbCJ48BApmFYRKowRoFWjNKPLCZtuWDDX S2hbsHtlV95clc2NDIWoPf/apLXlQea8H2ItzuuyNT2LOhJ5Jnbr6JU5bBA/f9TNt4JJ gp6D7RkDJKk5OZAN9KS7oQdmRLBORKGLDXwx5j4xfQEQozepzQSHBMUPpoCKHDc1UuKT h0YNIyohslktAMN+jP8gw6xH/Rvw0DaUOICeorZYlI34wxntrTFvjq0D3fbH1LaA3jgo am9Qfq2meZjUdwV7ROpuKyuanLntzQ4RMulEhwU11hXxNvEpIO+g/WHqtZZaHmVizyK/ 9Cgw== 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=pDJdJ9jg4hC1Qi0/LCWeL6vCBADxdHWZeYcpiMBLSJc=; b=XiOQ4yT9ry684Xdzvs9cFbf1lWKzlIMEWiM+4B6fIgQAAgXpQpTJzMbI5ERiZsgGIU NpBlAhaBN5QLUkLuPWEe3FmTw8nlY1IVsXMPbARI905AEoEBq88odO4BdFY9VUrFQPY6 5n8fvw3skkiaPcI+oMaoPXhaZ3p7Whx01c5Sy8149A05k1TncIdgixQddxV+/2w1Rb23 DqsqKH4gtbiVbFkFuXjP+cK3Zk6HMBqfUzxHdaoeo6dX0Q5LMjmvjjLO5l97X/t7x2Pu /joPg/6txkN9hcQjQ+gclPAPdpjFOn/8YQ6XH9hK+KwU4lyAy+IDT6A2AV0par1LA4ym VXKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nVp8+U0Q; 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 j23si1164186ejy.309.2020.12.09.11.00.34; Wed, 09 Dec 2020 11:00:59 -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=nVp8+U0Q; 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 S1733278AbgLIS46 (ORCPT + 99 others); Wed, 9 Dec 2020 13:56:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733050AbgLIS45 (ORCPT ); Wed, 9 Dec 2020 13:56:57 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F404C0613CF for ; Wed, 9 Dec 2020 10:56:16 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id t18so1444286plo.0 for ; Wed, 09 Dec 2020 10:56:16 -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=pDJdJ9jg4hC1Qi0/LCWeL6vCBADxdHWZeYcpiMBLSJc=; b=nVp8+U0Qroi2FT7wnDNiFbiJGQRepo6/TYrAIEWpub49d3b1Rf71FHqsD/IV1eDXAA vDl526q7G5TlunnyghLgc/5lsVrl47BiOypoqpedCRuFKslDZK9BLsAk2ITcKrcxhfUE 2N6mg+W4189MzMrHgSOsirbNic+iWTEixACsU= 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=pDJdJ9jg4hC1Qi0/LCWeL6vCBADxdHWZeYcpiMBLSJc=; b=LEqTwcAfJMG9kQS2bRoo6/AT2xE4V3yUPAGNhPWO10B+VLJHfos4PPiUBTC9HKUkPS 1jfafjNZoJJDvmOCLDPvSX0hePkZukFxTCRZPabIbeiMlxI1PabcqAkAtxV4heD3rVta LVTiqjEVQlOi1usnVcj64P8UJg/IhjGvfKCTPnXyLFyXwWJFsCvDkgEEf19aLq/zp+oT +tVcCJJwN4eZ1ruNcf1l1sRRiPl6JuZ3dpJJUFc2He7ki4xDUMSMgLuO5YGh7lZSX9ks 8/zOOpuGFtHV0xmbPfoV7O+xEE75aE6OHp6jFcT+B+3D1z2EVyU2kdOYZQqjDgCT6x2y 869w== X-Gm-Message-State: AOAM533CsGpo2d4Z0ekM9hv3spioZ3dmawUEYoib+Spux71TTR45FwXz NZBqN+SqE6pI45g5srl/hAl6qA== X-Received: by 2002:a17:90b:1294:: with SMTP id fw20mr3388768pjb.187.1607540176026; Wed, 09 Dec 2020 10:56:16 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id g85sm3347584pfb.4.2020.12.09.10.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Dec 2020 10:56:15 -0800 (PST) Date: Wed, 9 Dec 2020 10:56:14 -0800 From: Kees Cook To: Stephen Rothwell Cc: Andrew Morton , Linux Kernel Mailing List , Linux Next Mailing List , Michael Ellerman , PowerPC , Mathieu Malaterre , Nicholas Piggin Subject: Re: linux-next: build warning after merge of the akpm tree Message-ID: <202012091055.09D611EF31@keescook> References: <20201204210000.660293c6@canb.auug.org.au> <20201208230157.42c42789@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201208230157.42c42789@canb.auug.org.au> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 08, 2020 at 11:01:57PM +1100, Stephen Rothwell wrote: > Hi Stephen, > > On Fri, 4 Dec 2020 21:00:00 +1100 Stephen Rothwell wrote: > > > > Hi all, > > > > After merging the akpm tree, today's linux-next build (powerpc > > allyesconfig) produced warnings like this: > > > > ld: warning: orphan section `.data..Lubsan_data177' from `arch/powerpc/oprofile/op_model_pa6t.o' being placed in section `.data..Lubsan_data177' > > > > (lots of these latter ones) > > 781584 of them today! > > > I don't know what produced these, but it is in the akpm-current or > > akpm trees. > > Presumably the result of commit > > 186c3e18dba3 ("ubsan: enable for all*config builds") > > from the akpm-current tree. > > arch/powerpc/kernel/vmlinux.lds.S has: > > #ifdef CONFIG_PPC32 > .data : AT(ADDR(.data) - LOAD_OFFSET) { > DATA_DATA > #ifdef CONFIG_UBSAN > *(.data..Lubsan_data*) > *(.data..Lubsan_type*) > #endif > *(.data.rel*) > *(SDATA_MAIN) > > added by commit > > beba24ac5913 ("powerpc/32: Add .data..Lubsan_data*/.data..Lubsan_type* sections explicitly") > > in 2018, but no equivalent for 64 bit. > > I will try the following patch tomorrow: > > From: Stephen Rothwell > Date: Tue, 8 Dec 2020 22:58:24 +1100 > Subject: [PATCH] powerpc: Add .data..Lubsan_data*/.data..Lubsan_type* sections explicitly > > Similarly to commit > > beba24ac5913 ("powerpc/32: Add .data..Lubsan_data*/.data..Lubsan_type* sections explicitly") > > since CONFIG_UBSAN bits can now be enabled for all*config. > > Signed-off-by: Stephen Rothwell > --- > arch/powerpc/kernel/vmlinux.lds.S | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S > index 3b4c26e94328..0318ba436f34 100644 > --- a/arch/powerpc/kernel/vmlinux.lds.S > +++ b/arch/powerpc/kernel/vmlinux.lds.S > @@ -296,6 +296,10 @@ SECTIONS > #else > .data : AT(ADDR(.data) - LOAD_OFFSET) { > DATA_DATA > +#ifdef CONFIG_UBSAN > + *(.data..Lubsan_data*) > + *(.data..Lubsan_type*) > +#endif > *(.data.rel*) > *(.toc1) > *(.branch_lt) > -- > 2.29.2 > > -- > Cheers, > Stephen Rothwell Reviewed-by: Kees Cook Thanks for figuring this one out. :) Andrew, can you add this to your ubsan patch stack, or do you want me to resend it to you directly? -- Kees Cook