Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3121052rwb; Mon, 15 Aug 2022 18:38:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR6kal78clRTCrt0Qg/ZYZMPP0ytIu0Dh1kRysUD6BC0Byg97aoAI8vftwER+ci2PNfWkXZV X-Received: by 2002:a17:902:d54f:b0:16f:843d:efcb with SMTP id z15-20020a170902d54f00b0016f843defcbmr19698025plf.55.1660613892431; Mon, 15 Aug 2022 18:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613892; cv=none; d=google.com; s=arc-20160816; b=IXLbuNUyTY3ki6ms32tiRD5mqHKZrdRfBXHNFCIu5GIafjUbkXtOMH6cIi4VqN7YKP aCWMuo/E1J17V/bcJOnB3LinQydgtHtwvbpifteZQM111UAsJCrLmxhRbr3obheHaZML C1RViNA+pVHveHmW9scFh1qcHIIdWF9vtwvGnDhRB2+f4ID6Lss9jTuQ8PN0BlAFYyTC 1EEMApxVqk4vQJicleSCA3F4ZWbFMCupPiil97QNUgimdED3/lE6W1TkP85/+NRfqkgd p0WThpdgtEs79WrWPRnChRfEqF4atKTCFojwji+AiQUVNYHAIKpDDhE42nFSCtuKsMab cM3Q== 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=T8x7Y0kzKzA2aOlL0VKbWbNw7adtDeIekV6e96d+j/HiC/Ir93urdG/RtZejWATaHx Q2Jlkl68/XJ4l5VwWMJVYdPNVNmdanxZ8MbmT069J1Yzdnfj2uCPFnIsiz/dqwB9eXuh BpXKoGN9EjZzRdO7txmsvtl681cM04h89XGnr1qoGKsvHJrsORr7jP59uHoobPec0zbH QfibgQXJ8aGHnsvtpd+ly+lX5YvBVnQzRJeJn6YWTm1EZOOclE4xm4M03XjZAk8kwpYe nqyGeCShro4uRBDteBfyZb4auubgELW+/B8eiAw1H+h/3cG7JTsyrxkgM+ucakFnk1cn Ln/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MEVq3Mxp; 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 g67-20020a636b46000000b0041cea4daf7dsi12012365pgc.774.2022.08.15.18.37.50; Mon, 15 Aug 2022 18:38:12 -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=MEVq3Mxp; 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 S1348489AbiHPBF3 (ORCPT + 99 others); Mon, 15 Aug 2022 21:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349635AbiHPA6h (ORCPT ); Mon, 15 Aug 2022 20:58:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 616481A3917; Mon, 15 Aug 2022 13:50:01 -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 ams.source.kernel.org (Postfix) with ESMTPS id F2BA8B811AE; Mon, 15 Aug 2022 20:49:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B9CBC433C1; Mon, 15 Aug 2022 20:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596597; bh=dg9/iLNoP90yeUEWFEyZvSjml0J6j+qZ3W5XqIRkfYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MEVq3MxpbSOO9FLygwO4rD7no4JOWeF/Za1zSw4t7Cbw82LSWuqVrMEki5Am66/ng /L9sveX7IufrrowBiqER64PJThjL3jFR8OlhSvVvHdFBJom/n84c1xmGogE704tPtf w8PLKHB4XePICWlFf2naB2zBpig0AFhf2v9PAHbk= 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.19 1131/1157] tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH Date: Mon, 15 Aug 2022 20:08:07 +0200 Message-Id: <20220815180525.638574282@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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