Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5927119pxb; Tue, 16 Feb 2021 10:59:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzh2nQ471LbKYh1zSd9UolNSZbwRm4wHbkkbqNK4tFHgZJEZWaZks3CjQO5MNOJ4PXaH/vU X-Received: by 2002:a05:6402:35ca:: with SMTP id z10mr22555202edc.186.1613501970464; Tue, 16 Feb 2021 10:59:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613501970; cv=none; d=google.com; s=arc-20160816; b=b/JA9QTstsD+1MARontlhfTVTro8xZft4pIl4dS7F1jYBp6pCUEm/dZ7katZo00TxG QKOKwXNfND2klc0lGWDg/ejW+IDODTT6NrjHWK1gEjW8Xy5UwV1Zt0DwlmPU9H5r0rXS nUthqNUSGPjcgyrbRl+FjomKD0ZcNiqJr+iNzFeB34pQ8TDiFBhaZold/qLUm4Kx6ndX +aAr2scVgU1sQ0vWrq8okesCBzXe2BWI+Plc+wNfqjxOUR/3X4tF3T9lWioFiydJuM0f RCwB+8DOfxWAuHYubWQry7KX01BYFv8umWcsG8HVnLmTS42zjX8SYID59Kps41z54e9/ bYlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=MDKsmnfFpce/3FrV3IvONi8b+zCvhMgJaSu2ryA75gY=; b=0HYRptfRz1g1XHsI6+OmQxc60HBACOfaFmXTGLZN6r/AdNWdyism3Y/D9mPTf3O8rF GrwP5Z00/dVyttI+owK7z2Rzua4bWiITFBYKP7aJ//RHB3rcDU6lla8+iMKVthRGomsB MnVweP7cSsU9LGWaMzClHOrpPSEnqjLBLL6UrX43CMjvSEOSgShFuSThYMm9sZPFlcQF TLbWIcos43PlOWYmwW3f8xopXXY5ht2BuWxbl5mwaG32F0lzntPE/Lmmpp1cDdWVRA/a dnw6feXqAaPGMqQAQFzy1k5/X5P49lvYGCIKIpKW2i+YLy2r/HTo5saQV3DBQ4XTrhad bNTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PRPLQ5Tw; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j25si109270ejk.236.2021.02.16.10.59.06; Tue, 16 Feb 2021 10:59:30 -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=@kernel.org header.s=k20201202 header.b=PRPLQ5Tw; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231200AbhBPSzl (ORCPT + 99 others); Tue, 16 Feb 2021 13:55:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:48208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231135AbhBPSza (ORCPT ); Tue, 16 Feb 2021 13:55:30 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 60A9264EC8; Tue, 16 Feb 2021 18:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613501690; bh=XLdhnbxpQyUDI0ibwdZi9VWVTk4/FfIbiYNNHh0bGMo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PRPLQ5TwQ5HAvg963yD0IXfVeTU1PfgILSKT/zALIcuO2gE1ArT2oqoNRTFx0AvkL Re4t0dwNDMixZhUOBCnYlnUB4SUeeYbZA69yoB4O7I10DK7/mYSn+QaVeqptrom6ur fnCSuUvoYuIeNRqm1b7cMjhQbmEWOKDYRmGAXaE2A6YAKDixOHVxou7r7qbM8dQM+a XsHab8VVEigD8OhpAPfQ3dvi5fjwDwetEAjQjpOYTtLPusx8Jcw3h+lEbT14SByHeb L/rNkZjdiHrSlh0prLOEYNxbHJBSbQp2ArM+CHdx7e0ov4UxiHmUmTwsxK4TtiuCOZ sAORhJdGrR50Q== Date: Tue, 16 Feb 2021 11:54:47 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: Alexander Lobakin , Thomas Bogendoerfer , Arnd Bergmann , Nathan Chancellor , Huacai Chen , Pei Huang , Kees Cook , Sami Tolvanen , Fangrui Song , Jiaxun Yang , Ralf Baechle , Corey Minyard , kernel test robot , linux-mips@vger.kernel.org, LKML , linux-arch , clang-built-linux Subject: Re: [PATCH mips-next] vmlinux.lds.h: catch more UBSAN symbols into .data Message-ID: <20210216185447.GA64303@24bbad8f3778> References: <20210216085442.2967-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 16, 2021 at 09:56:32AM -0800, 'Nick Desaulniers' via Clang Built Linux wrote: > On Tue, Feb 16, 2021 at 12:55 AM Alexander Lobakin wrote: > > > > LKP triggered lots of LD orphan warnings [0]: > > Thanks for the patch, just some questions. > > With which linker? Was there a particular config from the bot's > report that triggered this? Looks like GNU ld 2.34 (see below). > > > > mipsel-linux-ld: warning: orphan section `.data.$Lubsan_data299' from > > `init/do_mounts_rd.o' being placed in section `.data.$Lubsan_data299' > > mipsel-linux-ld: warning: orphan section `.data.$Lubsan_data183' from > > `init/do_mounts_rd.o' being placed in section `.data.$Lubsan_data183' > > mipsel-linux-ld: warning: orphan section `.data.$Lubsan_type3' from > > `init/do_mounts_rd.o' being placed in section `.data.$Lubsan_type3' > > mipsel-linux-ld: warning: orphan section `.data.$Lubsan_type2' from > > `init/do_mounts_rd.o' being placed in section `.data.$Lubsan_type2' > > mipsel-linux-ld: warning: orphan section `.data.$Lubsan_type0' from > > `init/do_mounts_rd.o' being placed in section `.data.$Lubsan_type0' > > > > [...] > > > > Seems like "unnamed data" isn't the only type of symbols that UBSAN > > instrumentation can emit. > > Catch these into .data with the wildcard as well. > > > > [0] https://lore.kernel.org/linux-mm/202102160741.k57GCNSR-lkp@intel.com > > > > Fixes: f41b233de0ae ("vmlinux.lds.h: catch UBSAN's "unnamed data" into data") > > Reported-by: kernel test robot > > Signed-off-by: Alexander Lobakin > > --- > > include/asm-generic/vmlinux.lds.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h > > index cc659e77fcb0..83537e5ee78f 100644 > > --- a/include/asm-generic/vmlinux.lds.h > > +++ b/include/asm-generic/vmlinux.lds.h > > @@ -95,7 +95,7 @@ > > */ > > #ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION > > #define TEXT_MAIN .text .text.[0-9a-zA-Z_]* > > -#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral* .data.$__unnamed_* > > +#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral* .data.$__unnamed_* .data.$Lubsan_* > > Are these sections only created when > CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is selected? (Same with > .data.$__unnamed_*) Most likely, as that config is set in the problematic config. My guess is that these are GCC's equivalent of Clang's .data.$__unnamed_... $ crl https://lore.kernel.org/linux-mm/202102160741.k57GCNSR-lkp@intel.com/2-a.bin | gzip -d | rg "CONFIG_LD_DEAD_CODE|CONFIG_LD_VERSION" CONFIG_LD_VERSION=234000000 CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y > > #define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]* > > #define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L* > > #define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral* > > -- > > 2.30.1 > > > > > > > -- > Thanks, > ~Nick Desaulniers >