mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Guo Zihao <guozh23@xiaopeng.com>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	Ard Biesheuvel <ardb@kernel.org>,
	Matthew Garrett <matthewgarrett@google.com>,
	linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] tpm: efi: reject a final events table with an oversized preboot log
Date: Tue, 10 Nov 2026 05:58:03 +0200	[thread overview]
Message-ID: <avKWS0n3AQIIC3p3@kernel.org> (raw)
In-Reply-To: <179428010969.3920616.1180194759290419954@xiaopeng.com>

On Tue, Nov 10, 2026 at 11:08:29AM +0800, Guo Zihao wrote:
> Hi Jarkko,
> 
> No bus interposer is involved: the threat here is firmware shipping a
> self-contradictory final events table (preboot size larger than the
> table itself), not tampering on the wire. So the quantitative
> question - does this actually happen - does have data.
> 
> This area of efi.c has already needed fixes for real firmware tables
> four times:
> 
> - 05c8c1ff81ed ("efi/tpm: Don't traverse an event log with no
>   events"): some machines return an unpopulated template table whose
>   contents are just garbage.
> 
> - b4f1874c6216 ("tpm: check event log version before reading final
>   events"): several Dell models froze at boot because the firmware
>   event log and final events table did not match each other.
>   Fixes: includes 166a2809d65b.
> 
> - 80a6c216b16d ("tpm/eventlog: Don't abort tpm_read_log on faulty
>   ACPI address"): a Framework laptop with an INSYDE BIOS shipped an
>   un-mappable TPM2 ACPI table.
> 
> - 48cff270b037 ("tpm: efi: Use local variable for calculating final
>   log size"): this one is the closest. The same subtraction went
>   negative and hit __memcpy with a wrapped size, with a real oops in
>   the commit message. It carries Fixes: 166a2809d65b and went to
>   stable.
> 
> So the corrupted-table input and the negative-size memcpy path have
> both been observed in the wild, just not through this exact
> combination yet.
> 
> I'm fine either way on the tag. If you still consider this one
> hardening, I'll send a v3 without Fixes - the change itself is not
> affected by that.
> 
> Thanks.

OK, I think you are making a fair argument.

This is not just pure hardening given the various possibilities for
pure software (firmware) mishaps.

Maybe v3 with a reminder of why this crossed the border?

That said, I think I agree with you now.

Br, Jarkko

  reply	other threads:[~2026-11-10  3:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <au3xN-7onNTtgceh@kernel.org>
2026-11-10  3:08 ` Guo Zihao
2026-11-10  3:58   ` Jarkko Sakkinen [this message]
2026-11-06  1:49 Guo Zihao
2026-11-06  9:12 ` Ard Biesheuvel
2026-11-06 15:24 ` Jarkko Sakkinen
2026-11-09  1:49   ` Guo Zihao
2026-11-09 14:43     ` Jarkko Sakkinen
2026-11-09 14:45       ` Jarkko Sakkinen

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=avKWS0n3AQIIC3p3@kernel.org \
    --to=jarkko@kernel.org \
    --cc=ardb@kernel.org \
    --cc=guozh23@xiaopeng.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthewgarrett@google.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®