Add NX-compatibility patch

See https://github.com/rhboot/shim-review/issues/307 for background on
why this patch is needed.

BUG=b:263278288
TEST=make build-no-cache

Change-Id: I6141dc2a2fe9fb7f268afbc112dc238acd312374
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/shim-review/+/4415255
Reviewed-by: Jeffery Miller <jefferymiller@google.com>
Tested-by: Nicholas Bishop <nicholasbishop@google.com>
Auto-Submit: Nicholas Bishop <nicholasbishop@google.com>
Commit-Queue: Jeffery Miller <jefferymiller@google.com>
6 files changed
tree: 0501692a7ef281706715d708118d66f9fe292952
  1. patches/
  2. build_log.txt
  3. chromeos_reven.cer
  4. DIR_METADATA
  5. Dockerfile
  6. Makefile
  7. manifest
  8. nbishop.key
  9. OWNERS
  10. pnardini.key
  11. README.md
  12. sbat.csv
  13. shimia32.efi
  14. shimx64.efi
README.md

What organization or people are asking to have this signed?


Google


What product or service is this for?


ChromeOS (reven board)


What's the justification that this really does need to be signed for the whole world to be able to boot it?


ChromeOS is a Linux distribution. We want to enable (and encourage) our user base to boot ChromeOS (reven) with secure boot enabled.


Why are you unable to reuse shim from another distro that is already signed?


Reusing another distro's shim would require reusing their grub and kernel as well. We need to build our own kernel, so this would not work.


Who is the primary contact for security updates, etc.?


(Key should be signed by the other security contacts, pushed to a keyserver like keyserver.ubuntu.com, and preferably have signatures that are reasonably well known in the Linux community.)


Who is the secondary contact for security updates, etc.?


(Key should be signed by the other security contacts, pushed to a keyserver like keyserver.ubuntu.com, and preferably have signatures that are reasonably well known in the Linux community.)


Were these binaries created from the 15.7 shim release tar?

Please create your shim binaries starting with the 15.7 shim release tar file: https://github.com/rhboot/shim/releases/download/15.7/shim-15.7.tar.bz2

This matches https://github.com/rhboot/shim/releases/tag/15.7 and contains the appropriate gnu-efi source.


We confirm that our shim binaries are built from the referenced tarball.


URL for a repo that contains the exact code which was built to get this binary:


https://github.com/rhboot/shim/tree/15.7


What patches are being applied and why:



If shim is loading GRUB2 bootloader what exact implementation of Secureboot in GRUB2 do you have? (Either Upstream GRUB2 shim_lock verifier or Downstream RHEL/Fedora/Debian/Canonical-like implementation)


Upstream GRUB2 2.06 with shim_lock verifier. This verifier is included as long as --disable-shim-lock wasn't passed to grub-mkimage (and we do not set that flag). The verifier is enabled automatically when UEFI Secure Boot is enabled. Reference: https://www.gnu.org/software/grub/manual/grub/html_node/UEFI-secure-boot-and-shim.html


If shim is loading GRUB2 bootloader and your previously released shim booted a version of grub affected by any of the CVEs in the July 2020 grub2 CVE list, the March 2021 grub2 CVE list, the June 7th 2022 grub2 CVE list, or the November 15th 2022 list, have fixes for all these CVEs been applied?

  • CVE-2020-14372

  • CVE-2020-25632

  • CVE-2020-25647

  • CVE-2020-27749

  • CVE-2020-27779

  • CVE-2021-20225

  • CVE-2021-20233

  • CVE-2020-10713

  • CVE-2020-14308

  • CVE-2020-14309

  • CVE-2020-14310

  • CVE-2020-14311

  • CVE-2020-15705

  • CVE-2021-3418 (if you are shipping the shim_lock module)

  • CVE-2021-3695

  • CVE-2021-3696

  • CVE-2021-3697

  • CVE-2022-28733

  • CVE-2022-28734

  • CVE-2022-28735

  • CVE-2022-28736

  • CVE-2022-28737

  • CVE-2022-2601

  • CVE-2022-3775


Yes.


If these fixes have been applied, have you set the global SBAT generation on your GRUB binary to 3?


Yes.


Were old shims hashes provided to Microsoft for verification and to be added to future DBX updates?

Does your new chain of trust disallow booting old GRUB2 builds affected by the CVEs?


Pre-SBAT shim builds have been sent to Microsoft for revocation. Our current cert has not been used to sign anything pre-SBAT.


If your boot chain of trust includes a Linux kernel:

Is upstream commit 1957a85b0032a81e6482ca4aab883643b8dae06e “efi: Restrict efivar_ssdt_load when the kernel is locked down” applied?

Is upstream commit 75b0cea7bf307f362057cc778efe89af4c615354 “ACPI: configfs: Disallow loading ACPI tables when locked down” applied?

Is upstream commit eadb2f47a3ced5c64b23b90fd2a3463f63726066 “lockdown: also lock down previous kgdb use” applied?


Yes, all three commits are in the chromeos-5.10 branch our kernel is built from: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads/chromeos-5.10


Do you build your signed kernel with additional local patches? What do they do?


Our kernel is built from the chromeos-5.10 branch: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads/chromeos-5.10

This is the same kernel branch as all other ChromeOS devices that are on the 5.10 kernel. The chromeos-5.10 branch frequently merges the latest changes from the 5.10 stable kernel. There are a significant number of backports and ChromeOS-specific patches, too many to list here. ChromeOS-specific patches can be identified by the CHROMIUM: prefix in the commit message.


If you use vendor_db functionality of providing multiple certificates and/or hashes please briefly describe your certificate setup.

If there are allow-listed hashes please provide exact binaries for which hashes are created via file sharing service, available in public with anonymous access for verification.


We do not use this functionality.


If you are re-using a previously used (CA) certificate, you will need to add the hashes of the previous GRUB2 binaries exposed to the CVEs to vendor_dbx in shim in order to prevent GRUB2 from being able to chainload those older GRUB2 binaries. If you are changing to a new (CA) certificate, this does not apply.

Please describe your strategy.


N/A: we already switched to a new certificate for our Shim 15.4 submission: https://github.com/rhboot/shim-review/issues/204


What OS and toolchain must we use to reproduce this build? Include where to find it, etc. We‘re going to try to reproduce your build as closely as possible to verify that it’s really a build of the source tree you tell us it is, so these need to be fairly thorough. At the very least include the specific versions of gcc, binutils, and gnu-efi which were used, and where to find those binaries.

If the shim binaries can‘t be reproduced using the provided Dockerfile, please explain why that’s the case and what the differences would be.


The Dockerfile in this repository will reproduce our shim build. As a convenience, make build-no-cache will do a clean build.


Which files in this repo are the logs for your build?

This should include logs for creating the buildroots, applying patches, doing the build, creating the archives, etc.


build_log.txt


What changes were made since your SHIM was last signed?


  • Updated to shim 15.7
  • Added the 2022-11-15 GRUB security fixes
  • Updated shim and grub SBAT
  • Dropped hfs and hfsplus modules from our GRUB
  • Changed the Dockerfile to use Ubuntu 22.04 LTS as the image base

What is the SHA256 hash of your final SHIM binary?


5130b19ee82dd6ddd2fd41eeb7114c4fd517e5320bd5fdf19ac8f6fd185a99c8  shimia32.efi
81852d2dc5fd212d41cf807da9ee75bef75f1d50abf15b40698804921b5f0dd2  shimx64.efi

How do you manage and protect the keys used in your SHIM?


The keys used in this shim are generated and stored in an HSM. They are then encrypted for export to a signing fleet for usage in build signing by our CI pipeline, where they remain encrypted at rest. Only 4 trusted individuals in the org have access to the signing fleet machines, enforced by ACL and 2FA.


Do you use EV certificates as embedded certificates in the SHIM?


No.


Do you add a vendor-specific SBAT entry to the SBAT section in each binary that supports SBAT metadata ( grub2, fwupd, fwupdate, shim + all child shim binaries )?

Please provide exact SBAT entries for all SBAT binaries you are booting or planning to boot directly through shim.

Where your code is only slightly modified from an upstream vendor's, please also preserve their SBAT entries to simplify revocation.


shim SBAT:

sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
shim,3,UEFI shim,shim,1,https://github.com/rhboot/shim
shim.chromeos,2,ChromeOS,shim,15.7,https://chromium.googlesource.com/chromiumos/shim-review

grub SBAT:

sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
grub,3,Free Software Foundation,grub,2.06,https://www.gnu.org/software/grub/
grub.chromeos,2,ChromeOS,grub2,2.06,https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/refs/heads/main/sys-boot/grub/grub-2.06.ebuild

Which modules are built into your signed grub image?


  • boot
  • chain
  • configfile
  • efi_gop
  • ext2
  • fat
  • gptpriority
  • linux
  • normal
  • part_gpt
  • test

(Source file for reference)


What is the origin and full version number of your bootloader (GRUB or other)?


Grub 2.06

Grub patches are the same as our previous submission, except for adding the 2022-11-15 CVE patches.

  • 0001-Forward-port-ChromeOS-specific-GRUB-environment-vari.patch and 0002-Forward-port-gptpriority-command-to-GRUB-2.00.patch for picking the A or B boot slot.
  • 0003-Add-configure-option-to-reduce-visual-clutter-at-boo.patch from a Debian patch to make boot quieter.
  • 3 build-fix patches from Grub's master branch.
  • 2 whitespace-only patches from Grub's master branch to make the security patches apply cleanly.
  • 30 patches for the June 2022 CVEs.
  • 14 patches for the November 2022 CVEs.

If your SHIM launches any other components, please provide further details on what is launched.


N/A


If your GRUB2 launches any other binaries that are not the Linux kernel in SecureBoot mode, please provide further details on what is launched and how it enforces Secureboot lockdown.


N/A


How do the launched components prevent execution of unauthenticated code?


Our shim will only launch our signed GRUB2, which has built-in secure-boot support. GRUB2 will only launch our signed kernel, which is configured to enable lockdown.


Does your SHIM load any loaders that support loading unsigned kernels (e.g. GRUB)?


No


What kernel are you using? Which patches does it includes to enforce Secure Boot?


Our kernel is based on 5.10 and enforces lockdown. Source repo: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads/chromeos-5.10


Add any additional information you think we may need to validate this shim.


N/A