rhboot / shim-review

Reviews of shim
66 stars 131 forks source link

VMware Photon OS shim-15.8 #412

Closed nkkuntal closed 3 months ago

nkkuntal commented 7 months ago

Confirm the following are included in your repo, checking each box:


What is the link to your tag in a repo cloned from rhboot/shim-review?


https://github.com/nkkuntal/shim-review/tree/vmware-shim-x86_64-20240418


What is the SHA256 hash of your final SHIM binary?


$ sha256sum shimx64.efi
3c644e2d1f4449fa761c540615f2b59178639ae2fa74c493de71b951afc80e11  shimx64.efi

What is the link to your previous shim review request (if any, otherwise N/A)?


Previous version, based on shim 15.4, was approved here https://github.com/rhboot/shim-review/issues/164


If no security contacts have changed since verification, what is the link to your request, where they've been verified (if any, otherwise N/A)?


N/A as security contacts are not verified recently.

BogdanAriton commented 6 months ago

I'm not an official reviewer, but I'm trying to help as much as I can. This review if for: vmware-shim-x86_64-20240418.

3c644e2d1f4449fa761c540615f2b59178639ae2fa74c493de71b951afc80e11 ./shimx64.efi

    objdump ./shimx64_new.efi -s -j .sbatlevel

        ./shimx64_new.efi:     file format pei-x86-64

        Contents of section .sbatlevel:
        84000 00000000 08000000 37000000 73626174  ........7...sbat
        84010 2c312c32 30323330 31323930 300a7368  ,1,2023012900.sh
        84020 696d2c32 0a677275 622c330a 67727562  im,2.grub,3.grub
        84030 2e646562 69616e2c 340a0073 6261742c  .debian,4..sbat,
        84040 312c3230 32343031 30393030 0a736869  1,2024010900.shi
        84050 6d2c340a 67727562 2c330a67 7275622e  m,4.grub,3.grub.
        84060 64656269 616e2c34 0a00               debian,4..   
nkkuntal commented 6 months ago

Thank you @BogdanAriton for reviewing the shim-review.

The patch 0001-Introduce-support-for-revocations-build.patch utilizes the following code in shim.c: the function load_revocations_file() reads the provided revocations.efi, if it exists. In the case of valid .sbata and .sbatl section data, it updates the SbatLevel EFI variable by calling set_sbat_uefi_variable().

Consider a use case where Photon OS wants to revoke its grub2/kernel using SBAT. We could inject the aforementioned sections into revocations.efi generated with this patch. During the next boot, shim will update the SbatLevel and enforce the newly updated levels.

By utilizing this mechanism, we avoid changing SbatLevel in the shim source include/sbat_var_defs.h and avoid getting a new shim signed to revoke vendor binaries grub.photon and linux.photon.

BogdanAriton commented 6 months ago

Thank you @BogdanAriton for reviewing the shim-review.

The patch 0001-Introduce-support-for-revocations-build.patch utilizes the following code in shim.c: the function load_revocations_file() reads the provided revocations.efi, if it exists. In the case of valid .sbata and .sbatl section data, it updates the SbatLevel EFI variable by calling set_sbat_uefi_variable().

Consider a use case where Photon OS wants to revoke its grub2/kernel using SBAT. We could inject the aforementioned sections into revocations.efi generated with this patch. During the next boot, shim will update the SbatLevel and enforce the newly updated levels.

By utilizing this mechanism, we avoid changing SbatLevel in the shim source include/sbat_var_defs.h and avoid getting a new shim signed to revoke vendor binaries grub.photon and linux.photon.

@nkkuntal - thanks for clarifying that for me

dennis-tseng99 commented 5 months ago

Hi @nkkuntal, Because the global generation number has been bumped to 4 from 1, may I ask you a question about whether the product-specific minimum generation number is 1 or 2 in README.md:

grub2

sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
grub,4,Free Software Foundation,grub,2.06,https//www.gnu.org/software/grub/
grub.photon,2,VMware Photon OS,grub2,2.06-16.ph5,https://github.com/vmware/photon

I know your photon OS has been upgraded from 3.0 to 5.0 which can perfectly configure MACVLAN, VxLAN, macvtap .... I'm not sure this is your reason for 2.

In your previous shim-15.4 review:

grub2

sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
grub,1,Free Software Foundation,grub,2.06~rc1,https//www.gnu.org/software/grub/
grub.photon,1,VMware Photon OS,grub2,2.06~rc1-1.ph4,https://github.com/vmware/photon/tree/4.0/SPECS/grub2/

Please correct me if I'm wrong. Thank you very much.

vbrahmajosyula1 commented 5 months ago

Hi @dennis-tseng99

Thanks for taking time to review.

We chose to keep grub.photon to gen 2 as an indicator that our grub2 has transitioned from upstream grub2 to fedora downstream grub2.

dennis-tseng99 commented 5 months ago

Review for VMware Photon OS shim-15.8 #412 based on tag vmware-shim-x86_64-20240418

sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
grub,4,Free Software Foundation,grub,2.06,https//www.gnu.org/software/grub/
grub.photon,2,VMware Photon OS,grub2,2.06-16.ph5,https://github.com/vmware/photon

openssl x509 -in photon_sb2020.der -inform der -noout -text

Validity
            Not Before: Jul  8 01:53:00 2020 GMT
            Not After : Jan  1 06:59:59 2030 GMT
Subject: CN = "VMware, Inc.,O=VMware, Inc.,L=Palo Alto,S=California,C=US"
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                RSA Public-Key: (2048 bit)
THS-on commented 3 months ago

@nkkuntal did you get a signed shim back?

vbrahmajosyula1 commented 3 months ago

Sorry we forgot to mention it here. We ran into a logistical issue and were stuck for sometime. A couple of weeks ago we got the signed shim back. Thanks every one who helped review this.