Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3088748rwb; Mon, 15 Aug 2022 17:51:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR7HMnXZ7t2B0y0MG0Bc2vo3EyQgaRnO2B2FLCY0kbyqBOHOnyrId50qeFI38way0AWbDcUO X-Received: by 2002:a05:6402:2989:b0:43e:91be:fd20 with SMTP id eq9-20020a056402298900b0043e91befd20mr16854138edb.109.1660611074262; Mon, 15 Aug 2022 17:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611074; cv=none; d=google.com; s=arc-20160816; b=pxcKRoYLK44yL4bhZLxz+zW27mlo9Gi3m+o5Qjb2Th5jpFWvAYQNrBYL0FL7nF/O/R QuiEef0NMvFkOhUVFsc7yX7wWs3jYuTHXfagusSkI4k37s8i73ii9xbtIl3EYB1l1BFA zZ2cJopWApXJHkiq5wp1PmScJPm2GKQFZ8RpAaqRwvA2KPfA8PQ6QTNiJp0382Vlsfdz jNLU9+nKlk4jt/cIIcyAFdVCx5uDFFP4JraKLfBLmowtuajUWNyWsgi0EtCcKD14VkQE YXTaCQDqHTzI3oDX55lzlO+IjjJCXnN9Q/d3eooiBelhDL5gpN8iXIi3Bnk4KYZKcEfL pJWw== 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=qY/q3MA9mGuq+X6vNZ4Z1Mc7WGsDCTS9aTDIy381F1U=; b=qHWofQqrwBBEQeauiFAH7nfosSlha3i3OQyPZWVZkbnMuqcoFv9tE2uNxpHjcl+oN/ ubzhuPIstE8Pgluge1RBDRvNuEo08Q100h1bJBQwuxmhF0EM5BCPlOd+DZMoDQn6PntQ ML868VHf42tZePyt/sjAogWfn5gBd8xwJ5WY6BcmBLokY9x9aEQG7VIRKR5ciAOblk9e 3H/AY8yVqJfkBkjUnw+a5WSCrH2bDXLa+px5dHL2qg784oSUBh6Oha1SeCFHOIW8WTRL fX8zDWgafmazFDuClw3ZNpO67wsSCnPNp9jloDJ8bGDM3qjc6XLpdoxbeRfaDaINljIT 3whA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ibZ+2aqQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h20-20020aa7c614000000b0043d267cee03si8093854edq.299.2022.08.15.17.50.49; Mon, 15 Aug 2022 17:51:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ibZ+2aqQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1353952AbiHOXkK (ORCPT + 99 others); Mon, 15 Aug 2022 19:40:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353958AbiHOXhE (ORCPT ); Mon, 15 Aug 2022 19:37:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8818F82FB5; Mon, 15 Aug 2022 13:09:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2656660F11; Mon, 15 Aug 2022 20:09:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23909C433D6; Mon, 15 Aug 2022 20:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594179; bh=dg9/iLNoP90yeUEWFEyZvSjml0J6j+qZ3W5XqIRkfYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ibZ+2aqQCj0YQJyN2O3GFCm/m01TioONuKUaTtTTVcN500yh2pzk+BR3hml11vUxU 3JSPAcjT6gXU1iQcE4u955Voq0PiCTPndtApGzsCv4+RyQ/BsCVqjspq5yNy+4cJte GGLT4dqxbHn3cGieSo1dEv1SxEDwMDlVlcPZCLHU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, WANG Xuerui , Huacai Chen , Jarkko Sakkinen , Sasha Levin Subject: [PATCH 5.18 1068/1095] tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH Date: Mon, 15 Aug 2022 20:07:47 +0200 Message-Id: <20220815180513.219516805@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huacai Chen [ Upstream commit bed4593645366ad7362a3aa7bc0d100d8d8236a8 ] If DEBUG_SECTION_MISMATCH enabled, __calc_tpm2_event_size() will not be inlined, this cause section mismatch like this: WARNING: modpost: vmlinux.o(.text.unlikely+0xe30c): Section mismatch in reference from the variable L0 to the function .init.text:early_ioremap() The function L0() references the function __init early_memremap(). This is often because L0 lacks a __init annotation or the annotation of early_ioremap is wrong. Fix it by using __always_inline instead of inline for the called-once function __calc_tpm2_event_size(). Fixes: 44038bc514a2 ("tpm: Abstract crypto agile event size calculations") Cc: stable@vger.kernel.org # v5.3 Reported-by: WANG Xuerui Signed-off-by: Huacai Chen Signed-off-by: Jarkko Sakkinen Signed-off-by: Sasha Levin --- include/linux/tpm_eventlog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h index 739ba9a03ec1..20c0ff54b7a0 100644 --- a/include/linux/tpm_eventlog.h +++ b/include/linux/tpm_eventlog.h @@ -157,7 +157,7 @@ struct tcg_algorithm_info { * Return: size of the event on success, 0 on failure */ -static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, +static __always_inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, struct tcg_pcr_event *event_header, bool do_mapping) { -- 2.35.1