All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Huacai Chen <chenhuacai@loongson.cn>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	linux-integrity@vger.kernel.org,
	Xuefeng Li <lixuefeng@loongson.cn>,
	Huacai Chen <chenhuacai@gmail.com>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	stable@vger.kernel.org, WANG Xuerui <git@xen0n.name>
Subject: Re: [PATCH V2] tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH
Date: Mon, 11 Jul 2022 05:59:25 +0300	[thread overview]
Message-ID: <YsuSDe+Pn0QRN8di@kernel.org> (raw)
In-Reply-To: <20220711011738.3219487-1-chenhuacai@loongson.cn>

On Mon, Jul 11, 2022 at 09:17:38AM +0800, Huacai Chen wrote:
> 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
> Reported-by: WANG Xuerui <git@xen0n.name>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
> V2: Add Fixes tag and cc stable@vger.kernel.org
> 
>  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.31.1
> 


Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

BR, Jarkko

      reply	other threads:[~2022-07-11  2:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11  1:17 [PATCH V2] tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH Huacai Chen
2022-07-11  2:59 ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YsuSDe+Pn0QRN8di@kernel.org \
    --to=jarkko@kernel.org \
    --cc=chenhuacai@gmail.com \
    --cc=chenhuacai@loongson.cn \
    --cc=git@xen0n.name \
    --cc=jgg@ziepe.ca \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=peterhuewe@gmx.de \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.