All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/tboot: include all valid frame table entries in S3 integrity check
@ 2021-05-19 15:48 Jan Beulich
  2021-05-28  7:00 ` Ping: " Jan Beulich
  2021-05-31 10:08 ` Lukasz Hawrylko
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2021-05-19 15:48 UTC (permalink / raw)
  To: xen-devel; +Cc: Lukasz Hawrylko, Andrew Cooper, Wei Liu, Roger Pau Monné

The difference of two pdx_to_page() return values is a number of pages,
not the number of bytes covered by the corresponding frame table entries.

Fixes: 3cb68d2b59ab ("tboot: fix S3 issue for Intel Trusted Execution Technology.")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -323,12 +323,12 @@ static void tboot_gen_frametable_integri
         if ( nidx >= max_idx )
             break;
         vmac_update((uint8_t *)pdx_to_page(sidx * PDX_GROUP_COUNT),
-                       pdx_to_page(eidx * PDX_GROUP_COUNT)
-                       - pdx_to_page(sidx * PDX_GROUP_COUNT), &ctx);
+                    (eidx - sidx) * PDX_GROUP_COUNT * sizeof(*frame_table),
+                    &ctx);
     }
     vmac_update((uint8_t *)pdx_to_page(sidx * PDX_GROUP_COUNT),
-                   pdx_to_page(max_pdx - 1) + 1
-                   - pdx_to_page(sidx * PDX_GROUP_COUNT), &ctx);
+                (max_pdx - sidx * PDX_GROUP_COUNT) * sizeof(*frame_table),
+                &ctx);
 
     *mac = vmac(NULL, 0, nonce, NULL, &ctx);
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Ping: [PATCH] x86/tboot: include all valid frame table entries in S3 integrity check
  2021-05-19 15:48 [PATCH] x86/tboot: include all valid frame table entries in S3 integrity check Jan Beulich
@ 2021-05-28  7:00 ` Jan Beulich
  2021-05-31 10:08 ` Lukasz Hawrylko
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2021-05-28  7:00 UTC (permalink / raw)
  To: Lukasz Hawrylko; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné, xen-devel

On 19.05.2021 17:48, Jan Beulich wrote:
> The difference of two pdx_to_page() return values is a number of pages,
> not the number of bytes covered by the corresponding frame table entries.
> 
> Fixes: 3cb68d2b59ab ("tboot: fix S3 issue for Intel Trusted Execution Technology.")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/tboot.c
> +++ b/xen/arch/x86/tboot.c
> @@ -323,12 +323,12 @@ static void tboot_gen_frametable_integri
>          if ( nidx >= max_idx )
>              break;
>          vmac_update((uint8_t *)pdx_to_page(sidx * PDX_GROUP_COUNT),
> -                       pdx_to_page(eidx * PDX_GROUP_COUNT)
> -                       - pdx_to_page(sidx * PDX_GROUP_COUNT), &ctx);
> +                    (eidx - sidx) * PDX_GROUP_COUNT * sizeof(*frame_table),
> +                    &ctx);
>      }
>      vmac_update((uint8_t *)pdx_to_page(sidx * PDX_GROUP_COUNT),
> -                   pdx_to_page(max_pdx - 1) + 1
> -                   - pdx_to_page(sidx * PDX_GROUP_COUNT), &ctx);
> +                (max_pdx - sidx * PDX_GROUP_COUNT) * sizeof(*frame_table),
> +                &ctx);
>  
>      *mac = vmac(NULL, 0, nonce, NULL, &ctx);
>  
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/tboot: include all valid frame table entries in S3 integrity check
  2021-05-19 15:48 [PATCH] x86/tboot: include all valid frame table entries in S3 integrity check Jan Beulich
  2021-05-28  7:00 ` Ping: " Jan Beulich
@ 2021-05-31 10:08 ` Lukasz Hawrylko
  1 sibling, 0 replies; 3+ messages in thread
From: Lukasz Hawrylko @ 2021-05-31 10:08 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné

On Wed, 2021-05-19 at 17:48 +0200, Jan Beulich wrote:
> The difference of two pdx_to_page() return values is a number of pages,
> not the number of bytes covered by the corresponding frame table entries.
> 
> Fixes: 3cb68d2b59ab ("tboot: fix S3 issue for Intel Trusted Execution Technology.")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 

Reviewed-by: Lukasz Hawrylko <lukasz.hawrylko@linux.intel.com>




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-31 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 15:48 [PATCH] x86/tboot: include all valid frame table entries in S3 integrity check Jan Beulich
2021-05-28  7:00 ` Ping: " Jan Beulich
2021-05-31 10:08 ` Lukasz Hawrylko

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.