Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp329789pxb; Mon, 16 Aug 2021 06:28:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJww5ZOLelQPrXgSjSvPaAgNV1a0oIAjFjaFtk+MtnE1nKO7faD1V3irMrwCgvPmFwqH6lLn X-Received: by 2002:aa7:c894:: with SMTP id p20mr20175756eds.42.1629120489932; Mon, 16 Aug 2021 06:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629120489; cv=none; d=google.com; s=arc-20160816; b=kCJYUHXQXOisamGraDrsUrWCrOWvyx/VOL4NcuUQhMeKYVLFHkjhTutY8c4JXOe2XU oqQb+xzcnRLIsP/0bvbC1uCKuQTwFbwTAi8a3IcugE//DH0Ac3uW2xSU9jFbqfgXO5Yk z8kucrur1wqunQNLpsFUCRR8e8sG7DJv46Ga3lnYc9P3kRuCbEe1i7+mEReRWwB349A9 4WkoVG3QPrdDzgRD+nJGwaQuOFg8kMt2W4bw6iRHNxUJ8Jk2ExNVjKz7EF36ryiDUZPS p1y70fF4pM/+2RW/YR+1UwyeEZ2aTErC7URcFjoVfouEQaYV1WF+6+dMzYhu7Ga3x60C ICkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CykQng7OsxHnqx9oZzRxgh2kEuzE146gptVHgRQ2TIg=; b=f+i/CAhAVS9IEsZ/5p01WBHjUmP52H/52p6m3+NX7XXk8xQPeYndqMTjHNUYHKoMfa tgNcn6a4cSuxw3uCFn6fwf066fXWwMHocHYVQJsV69ufL/BhgEt7CWEJtiYXV4pihcUQ +P1yEgGGgEOXCRx13pYsBhGkPl2kuUHYqTu++fTEpNsx1RoUPduOGrhhiamlHCA75u2g ZHUdEVWgP9ZbqRV5L6NWKUSiNAF2S7TTn7cwSKRfPGu/lBFcZp0R5MDPO6EwtKz7rPvw +8TOACVSdJq4Ht4YRXkQdaQoq/pxm5i1I9mm2lStdL4gwHJ2utEj9Zybuww41z7XkslV xdOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TQrMG7v0; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gg2si9816457ejb.176.2021.08.16.06.27.46; Mon, 16 Aug 2021 06:28:09 -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=@linuxfoundation.org header.s=korg header.b=TQrMG7v0; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240517AbhHPNY1 (ORCPT + 99 others); Mon, 16 Aug 2021 09:24:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:39186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237550AbhHPNNE (ORCPT ); Mon, 16 Aug 2021 09:13:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0CE0B632BD; Mon, 16 Aug 2021 13:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1629119449; bh=RhT6lIZQj7cP7GzN6vcapHIZwDhnXX/XNXOft6q2p6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TQrMG7v0xk2sh4BQ4q5PUAZeL+I+Q0SkIO/odCRLNTu4WjkJR09xCXWo5YdmK4XcU 62/I5mX1NUXGCAIfB59sOVDrkugrv35yX6jWhIZ01dNDT/uoJ/QPSTah+mBEI5KtWU Y69a49smY5hM3Oi7ZRLpCbhfvo+jczZHIpEFjHAU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Fangrui Song , Marco Elver , Kees Cook Subject: [PATCH 5.13 031/151] vmlinux.lds.h: Handle clangs module.{c,d}tor sections Date: Mon, 16 Aug 2021 15:01:01 +0200 Message-Id: <20210816125445.099650753@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210816125444.082226187@linuxfoundation.org> References: <20210816125444.082226187@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor commit 848378812e40152abe9b9baf58ce2004f76fb988 upstream. A recent change in LLVM causes module_{c,d}tor sections to appear when CONFIG_K{A,C}SAN are enabled, which results in orphan section warnings because these are not handled anywhere: ld.lld: warning: arch/x86/pci/built-in.a(legacy.o):(.text.asan.module_ctor) is being placed in '.text.asan.module_ctor' ld.lld: warning: arch/x86/pci/built-in.a(legacy.o):(.text.asan.module_dtor) is being placed in '.text.asan.module_dtor' ld.lld: warning: arch/x86/pci/built-in.a(legacy.o):(.text.tsan.module_ctor) is being placed in '.text.tsan.module_ctor' Fangrui explains: "the function asan.module_ctor has the SHF_GNU_RETAIN flag, so it is in a separate section even with -fno-function-sections (default)". Place them in the TEXT_TEXT section so that these technologies continue to work with the newer compiler versions. All of the KASAN and KCSAN KUnit tests continue to pass after this change. Cc: stable@vger.kernel.org Link: https://github.com/ClangBuiltLinux/linux/issues/1432 Link: https://github.com/llvm/llvm-project/commit/7b789562244ee941b7bf2cefeb3fc08a59a01865 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Reviewed-by: Fangrui Song Acked-by: Marco Elver Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210731023107.1932981-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman --- include/asm-generic/vmlinux.lds.h | 1 + 1 file changed, 1 insertion(+) --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -586,6 +586,7 @@ NOINSTR_TEXT \ *(.text..refcount) \ *(.ref.text) \ + *(.text.asan.* .text.tsan.*) \ TEXT_CFI_JT \ MEM_KEEP(init.text*) \ MEM_KEEP(exit.text*) \