lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0925430dad9e55179be0df89d8af1df72dfa0c89.camel@HansenPartnership.com>
Date: Thu, 10 Jul 2025 14:58:16 -0700
From: James Bottomley <James.Bottomley@...senPartnership.com>
To: yangge1116@....com, ardb@...nel.org
Cc: jarkko@...nel.org, sathyanarayanan.kuppuswamy@...ux.intel.com, 
	ilias.apalodimas@...aro.org, jgg@...pe.ca, linux-efi@...r.kernel.org, 
	linux-kernel@...r.kernel.org, stable@...r.kernel.org, liuzixing@...on.cn
Subject: Re: [PATCH V3] efi/tpm: Fix the issue where the CC platforms event
 log header can't be correctly identified

On Mon, 2025-07-07 at 11:14 +0800, yangge1116@....com wrote:
> The pcr_idx value in the Intel TDX log header is 1, causing the
> function __calc_tpm2_event_size() to fail to recognize the log
> header, ultimately leading to the "Failed to parse event in TPM Final
> Events Log" error.
> 
> According to UEFI Specification 2.10, Section 38.4.1: For TDX, TPM
> PCR 0 maps to MRTD, so the log header uses TPM PCR 1 instead. To
> successfully parse the TDX event log header, the check for a pcr_idx
> value of 0 must be skipped.

I think someone has misread the spec.  EV_NO_ACTION events produce no
PCR extension.  So the PCR value zero is conventional (and required by
the TCG) since nothing gets logged.  Therefore even if you're
technically using PCR0 for something else EV_NO_ACTION events should
still have the conventional PCR = 0 value to conform to the TCG spec. 
I assume it's too late to correct this in the implementation?

>  __calc_tpm2_event_size(struct tcg_pcr_event2_head *ev
>  	count = event->count;
>  	event_type = event->event_type;
>  
> -	/* Verify that it's the log header */
> -	if (event_header->pcr_idx != 0 ||
> +	/*
> +	 * Verify that it's the log header. According to the TCG PC
> Client
> +	 * Specification, when identifying a log header, the check
> for a
> +	 * pcr_idx value of 0 is not required. For CC platforms,
> skipping
> +	 * this check during log header is necessary; otherwise, the
> CC
> +	 * platform's log header may fail to be recognized.
> +	 */
> +	if ((!is_cc_event && event_header->pcr_idx != 0) ||
>  	    event_header->event_type != NO_ACTION ||
>  	    memcmp(event_header->digest, zero_digest,
> sizeof(zero_digest))) {
>  		size = 0;

The above is just a heuristic to recognize an EV_NO_ACTION event as
zero size.  All the TCG specs require that EV_NO_ACTION have pcr 0 in
the event, but if the heuristic is wrong because of Intel/CC spec
violations which can't be fixed, then we should update the heuristic
... so I don't think you need to thread the is_cc_event.

Regards,

James

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ