Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5373136pxu; Wed, 21 Oct 2020 23:51:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymWKy91JPOm8RXcVej91fGwJyBYN8fmfNlFhWpEhwqxG+X6IzolN0EW75B2Cve0Pxj/8TP X-Received: by 2002:a17:906:edc8:: with SMTP id sb8mr854013ejb.241.1603349507105; Wed, 21 Oct 2020 23:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603349507; cv=none; d=google.com; s=arc-20160816; b=qpVNUvdP9r40oqg8QmJtZsNCPD4ifZK7rBBfeLfvSYzc4NtFbHLCMlL7kW/yjZ1Z/U IMx4dtxRhxB8aBR+wykgJToFh71mTor6Fd6hJzIXAl4SNkOLXkuqjaX4sqbaDK+snY8Y mk68sFMbV64P6Y6QC5FlcwrBGsn119jxB6f7/RTkgaI5ioLGnmJl5BClTNkW+V4nMeCu cBtIp4YpBivEp8On8caDcm5XiEMxQwNn9HO3YcwTTa8AtN7hotdPw8QIipZeTD7lEJeL NijvXermlPUknwugXG9Gu4bymW8GfGGMOGLwqmF1dQGm7yAgTYSP+RebcZmg6UAVI91V 1JzA== 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=MyV1gJcxFAQQ3ezKzLWjL48pP/r6NIsOLeLTCnNX+6g=; b=r5LDo0iOiVscGk/y1H8fjprokD3+TNFvxZS+OeZR1zHRoOd22hJ1b1sLreB/r4cybM thgDNSHnhFHNpB4DYvow1qujtNA9codMa19zXkriiK8mcwqXBOQBWE9jtdAo0lCb8j8P cJWkhG/lJlyESBDkAfV1HyDkquTG6nfGKFn+fh/zY03STAWYMnVQvfE0yKHCfPee1SLv GNo944aLPVAqWMaQzsSFsaaJ0Ilibe0Ju+0znW+gV3gRPPWS7Mwy1/aIfxi3IkV12nj2 LgLemqbCOgkBjBmfeNO3Ysm6n529d6fTqPBLAYCGrfFIH69XhaXYWR+YITWkpyUFxgqg 8bpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gd9gv83u; 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 z10si280461eje.564.2020.10.21.23.51.25; Wed, 21 Oct 2020 23:51:47 -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=gd9gv83u; 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 S2443228AbgJUUEk (ORCPT + 99 others); Wed, 21 Oct 2020 16:04:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410567AbgJUUEj (ORCPT ); Wed, 21 Oct 2020 16:04:39 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26338C0613CF for ; Wed, 21 Oct 2020 13:04:38 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id e10so2152783pfj.1 for ; Wed, 21 Oct 2020 13:04:38 -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=MyV1gJcxFAQQ3ezKzLWjL48pP/r6NIsOLeLTCnNX+6g=; b=gd9gv83uo3riBYpEs8PF3ugJNfzSNB4r5uzG6neNC4ucEYQ70ZAQ7SkiViN2BDIWTa 5FHnXZOzUUXdLzYnMhbsr4d8rz7li3H7J2bDv1CYRYR7wKMufb2lQRs+5RTT7gbMjECa QVv/pSQcNG3DxcpZ6JCFwhdlQlG2CHDdUMhOo= 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=MyV1gJcxFAQQ3ezKzLWjL48pP/r6NIsOLeLTCnNX+6g=; b=FFXTGUxEoQFUNN9eE0U5L602Lb8BFF6OcE3mkMRjYglmLy1Ey2gT47Xj2A9tV2rYj+ ztBXNKVMNNXWgVL/wXYoo0ZBWfuVScd5hvRn/8MdlBsuIrC5DVEF0ZXmD3t5ZtCnLCI4 d2tqFTQAbImTytzcqPR7GQXpMfz+5taj6MwAt+WWpTatAwXNqQJBWgsN6K/QrtrOdR+5 AKfYwXy0MvRC3+P6Gk9xvD0Avjpa1HNH87+qphESdnLpExQWIrzu9Z6jsV8ZWjm3FlwR rPxrnHXLMQPbhqncbQ1CWljzNKJ/9D1AR4Dga76MwUPdUaKmG18ZP+QLO4n2+ZAdCpRy 8C9g== X-Gm-Message-State: AOAM531fgipmnRtu1JYC1lGGon27/tQZStoG3v1k5ShyUWuBACFdHnE6 84ihaPVS8Rmg13UmkECFXb1qHg== X-Received: by 2002:a65:664a:: with SMTP id z10mr4742041pgv.171.1603310677590; Wed, 21 Oct 2020 13:04:37 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n18sm3102678pff.129.2020.10.21.13.04.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 13:04:36 -0700 (PDT) Date: Wed, 21 Oct 2020 13:04:35 -0700 From: Kees Cook To: Ingo Molnar , x86@kernel.org Cc: Stephen Rothwell , Nick Desaulniers , Arnd Bergmann , clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] vmlinux.lds.h: Keep .ctors.* with .ctors Message-ID: <202010211303.4F8386F2@keescook> References: <20201005025720.2599682-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201005025720.2599682-1-keescook@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [thread ping: x86 maintainers, can someone please take this?] On Sun, Oct 04, 2020 at 07:57:20PM -0700, Kees Cook wrote: > Under some circumstances, the compiler generates .ctors.* sections. This > is seen doing a cross compile of x86_64 from a powerpc64el host: > > x86_64-linux-gnu-ld: warning: orphan section `.ctors.65435' from `kernel/trace/trace_clock.o' being > placed in section `.ctors.65435' > x86_64-linux-gnu-ld: warning: orphan section `.ctors.65435' from `kernel/trace/ftrace.o' being > placed in section `.ctors.65435' > x86_64-linux-gnu-ld: warning: orphan section `.ctors.65435' from `kernel/trace/ring_buffer.o' being > placed in section `.ctors.65435' > > Include these orphans along with the regular .ctors section. > > Reported-by: Stephen Rothwell > Tested-by: Stephen Rothwell > Fixes: 83109d5d5fba ("x86/build: Warn on orphan section placement") > Signed-off-by: Kees Cook > --- > v2: brown paper bag version: fix whitespace for proper backslash alignment > --- > include/asm-generic/vmlinux.lds.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h > index 5430febd34be..b83c00c63997 100644 > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -684,6 +684,7 @@ > #ifdef CONFIG_CONSTRUCTORS > #define KERNEL_CTORS() . = ALIGN(8); \ > __ctors_start = .; \ > + KEEP(*(SORT(.ctors.*))) \ > KEEP(*(.ctors)) \ > KEEP(*(SORT(.init_array.*))) \ > KEEP(*(.init_array)) \ > -- > 2.25.1 > -- Kees Cook