diff mbox series

[2/3] efi_loader: fix boot_service_capability_min calculation

Message ID 20210903015552.17180-3-masahisa.kojima@linaro.org
State Accepted
Commit db3ed2cf9c67ed6a0da0bab6e43edae90ced4bf2
Headers show
Series Miscellaneous fixes of efi_tcg2 | expand

Commit Message

Masahisa Kojima Sept. 3, 2021, 1:55 a.m. UTC
TCG EFI Protocol Specification requires to the input
ProtocolCapability.Size < size of the EFI_TCG2_BOOT_SERVICE_CAPABILITY
up to and including the vendor ID field.
Current implementation does different calculation, let's fix it.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>

---
 include/efi_tcg2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.1

Comments

Ilias Apalodimas Sept. 3, 2021, 6:19 a.m. UTC | #1
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


On Fri, 3 Sept 2021 at 04:54, Masahisa Kojima
<masahisa.kojima@linaro.org> wrote:
>

> TCG EFI Protocol Specification requires to the input

> ProtocolCapability.Size < size of the EFI_TCG2_BOOT_SERVICE_CAPABILITY

> up to and including the vendor ID field.

> Current implementation does different calculation, let's fix it.

>

> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>

> ---

>  include/efi_tcg2.h | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h

> index b6b958da51..45788d55d5 100644

> --- a/include/efi_tcg2.h

> +++ b/include/efi_tcg2.h

> @@ -127,8 +127,8 @@ struct efi_tcg2_boot_service_capability {

>         efi_tcg_event_algorithm_bitmap active_pcr_banks;

>  };

>

> +/* up to and including the vendor ID(manufacture_id) field */

>  #define boot_service_capability_min \

> -       sizeof(struct efi_tcg2_boot_service_capability) - \

>         offsetof(struct efi_tcg2_boot_service_capability, number_of_pcr_banks)

>

>  #define TCG_EFI_SPEC_ID_EVENT_SIGNATURE_03 "Spec ID Event03"

> --

> 2.17.1

>
Heinrich Schuchardt Sept. 3, 2021, 7:01 a.m. UTC | #2
On 9/3/21 3:55 AM, Masahisa Kojima wrote:
> TCG EFI Protocol Specification requires to the input

> ProtocolCapability.Size < size of the EFI_TCG2_BOOT_SERVICE_CAPABILITY

> up to and including the vendor ID field.


> Current implementation does different calculation, let's fix it.

>

> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>

> ---

>   include/efi_tcg2.h | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h

> index b6b958da51..45788d55d5 100644

> --- a/include/efi_tcg2.h

> +++ b/include/efi_tcg2.h

> @@ -127,8 +127,8 @@ struct efi_tcg2_boot_service_capability {

>   	efi_tcg_event_algorithm_bitmap active_pcr_banks;

>   };

>

> +/* up to and including the vendor ID(manufacture_id) field */


Thank you for fixing the issue. There is just a typo above:

%s/manufacture_id/manufacturer_id/

I can fix that when merging

>   #define boot_service_capability_min \


Constants should be capitalized. This can be corrected in a future patch.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


> -	sizeof(struct efi_tcg2_boot_service_capability) - \

>   	offsetof(struct efi_tcg2_boot_service_capability, number_of_pcr_banks)

>

>   #define TCG_EFI_SPEC_ID_EVENT_SIGNATURE_03 "Spec ID Event03"

>
Masahisa Kojima Sept. 3, 2021, 7:24 a.m. UTC | #3
On Fri, 3 Sept 2021 at 16:01, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>

> On 9/3/21 3:55 AM, Masahisa Kojima wrote:

> > TCG EFI Protocol Specification requires to the input

> > ProtocolCapability.Size < size of the EFI_TCG2_BOOT_SERVICE_CAPABILITY

> > up to and including the vendor ID field.

>

> > Current implementation does different calculation, let's fix it.

> >

> > Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>

> > ---

> >   include/efi_tcg2.h | 2 +-

> >   1 file changed, 1 insertion(+), 1 deletion(-)

> >

> > diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h

> > index b6b958da51..45788d55d5 100644

> > --- a/include/efi_tcg2.h

> > +++ b/include/efi_tcg2.h

> > @@ -127,8 +127,8 @@ struct efi_tcg2_boot_service_capability {

> >       efi_tcg_event_algorithm_bitmap active_pcr_banks;

> >   };

> >

> > +/* up to and including the vendor ID(manufacture_id) field */

>

> Thank you for fixing the issue. There is just a typo above:

>

> %s/manufacture_id/manufacturer_id/

>

> I can fix that when merging


Sorry for my typo, thank you.

>

> >   #define boot_service_capability_min \

>

> Constants should be capitalized. This can be corrected in a future patch.


Thank you, I will fix it after this patch merged.

Thanks,
Masahisa Kojima

>

> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

>

> > -     sizeof(struct efi_tcg2_boot_service_capability) - \

> >       offsetof(struct efi_tcg2_boot_service_capability, number_of_pcr_banks)

> >

> >   #define TCG_EFI_SPEC_ID_EVENT_SIGNATURE_03 "Spec ID Event03"

> >
diff mbox series

Patch

diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h
index b6b958da51..45788d55d5 100644
--- a/include/efi_tcg2.h
+++ b/include/efi_tcg2.h
@@ -127,8 +127,8 @@  struct efi_tcg2_boot_service_capability {
 	efi_tcg_event_algorithm_bitmap active_pcr_banks;
 };
 
+/* up to and including the vendor ID(manufacture_id) field */
 #define boot_service_capability_min \
-	sizeof(struct efi_tcg2_boot_service_capability) - \
 	offsetof(struct efi_tcg2_boot_service_capability, number_of_pcr_banks)
 
 #define TCG_EFI_SPEC_ID_EVENT_SIGNATURE_03 "Spec ID Event03"