Open dbnicholson opened 3 months ago
7859e02e1fc6dff8e2b221dfcbfaffcb6d1e95e2acb65403e5db7c849f9221cd shimx64.efi
)CN=Endless Secure Boot CA
Nov 1 23:41:42 2016 GMT
2B:F1:FA:0D:1D:0C:AB:5E:EB:B1:B8:95:09:94:EF:4A:4B:9C:5C:00
CN=Endless Secure Boot CA
Dec 1 17:06:09 2019 GMT
DA:E6:9E:A6:CA:A2:E8:13:59:FF:ED:44:FE:7D:CF:5B:2A:84:5E:2B
CN=Endless Secure Boot CA
Dec 3 17:52:41 2029 GMT
63:FC:D2:3A:E3:17:14:81:0B:71:9A:95:5E:53:27:E1:A9:F6:0A:E9
CN=Endless Secure Boot CA
May 30 03:15:05 2052 GMT
(roughly 28 years)DllCharacteristics 00000000
)Issue/question:
https://github.com/endlessm/shim/tree/endless/15.8-1_deb12u1endless1
it should pull the official tarball from https://github.com/rhboot/shim/releases/tag/15.8 and apply patches atop of that.@es-fabricemarie thanks for the review!
- build docker pulls shim from
https://github.com/endlessm/shim/tree/endless/15.8-1_deb12u1endless1
it should pull the official tarball from https://github.com/rhboot/shim/releases/tag/15.8 and apply patches atop of that.
It actually does use the official tarball, but it restores it using pristine-tar
from this data. I can update the Dockerfile
so it shows the actual tarball used during the build. https://deb.endlessos.org/debian/pool/core/s/shim/shim_15.8-1~deb12u1endless1.dsc shows the data from the generated source package including the checksum of the tarball:
Checksums-Sha256:
a79f0a9b89f3681ab384865b1a46ab3f79d88b11b4ca59aa040ab03fffae80a9 2315201 shim_15.8.orig.tar.bz2
fcbd64a83973fdcec6a0f98aef07ba5e288ff2d07f1050bc6f9c3bdd875caed3 228 shim_15.8.orig.tar.bz2.asc
baf1852fba47e2bd401d81169b6899b0b18b8fa93af6b7d1680b54dfe4c967fd 65700 shim_15.8-1~deb12u1endless1.debian.tar.xz
The security contacts have not changed, however I can't find any indication of verification in any previous reviews. Those are:
176 #105 #61
Let's do this from scratch then...
Mails on the way.
I got: distention knuckling unexceptionable hydras tourneys comeliness fraternize Villa cosmetologists domains
craws showbiz switch Dramamine unannounced internists babysitters tared quantum jouncing
The verb “to jounce” is new to me.
Thanks!
- additional shim patches present will need more eyeballs/reviews.
In case this is holding up the review, I'd like to discuss these. There are 4 patches:
The first 2 are backports from upstream post-15.8 and inherited from Debian. They simply make the newer SBAT policies available for use. The second 2 are our real downstream patches. They're both against fallback and are trying to address the same issue. 0003-Revert-fallback-work-around-the-issue-of-boot-option.patch
is really an optimization once 0004-fallback-Clean-up-duplicate-boot-entries.patch
is applied. So, really 0004-fallback-Clean-up-duplicate-boot-entries.patch
is the downstream change we make.
Endless OS is always installed by flashing a raw disk image containing filesystems. By definition, the filesystems in the disk image contain UUIDs. During first boot the UUIDs are randomized since they'd no longer be unique if every Endless OS installation had the same partition UUIDs. However, changing the ESP UUID means that existing EFI load options referencing that partition are now invalid. What currently happens is this:
endless/BOOT<arch>.csv
, creates a new load option referencing the current ESP UUID and loads it.The problem 0004-fallback-Clean-up-duplicate-boot-entries.patch
is trying to address is after step 4. If the invalid load option isn't removed, then there will be 2 entries for Endless OS
, one of which is invalid. That's a poor user experience, so what the patch does is add a routine to delete any existing options with the desired title before adding the new load option. That means you can only have one load option with a given title created by fallback. If your system had another ESP or there was another vendor directory and either provided a load option with the same title, they would be deleted.
This works OK for Endless OS since that type of advanced functionality isn't supported, but it means the patch isn't really upstreamable. I've been working on a tool that updates the partition UUID in an existing load option, which we'd run at step 4 when the UUID is changed. I'm actually surprised that kind of tool doesn't exist (the closest I've seen is to manually do it with efibootmgr
), but maybe people changing their ESP UUID is rare enough that the problem is ignored. Anyways, if it would speed up review to drop that patch, I can try to finish up my tool and get it integrated in Endless OS.
I was able to finish up the work that handles updating the UUID in the load option after the ESP partition UUID is changed. The program is here if anyone cares. With that I was able to update our shim package to drop our 2 downstream fallback patches (0003-Revert-fallback-work-around-the-issue-of-boot-option.patch and 0004-fallback-Clean-up-duplicate-boot-entries.patch).
The shim binary is exactly the same as before since the patches were against fallback rather than shim. Still, I've updated our shim-review repo with the current build log. The new tag is https://github.com/endlessm/shim-review/releases/tag/endless-shim-x64-20240912. @es-fabricemarie would you mind reviewing again? Everything should be the same as before except for the 2 dropped patches.
Sorry for the delay @dbnicholson
7859e02e1fc6dff8e2b221dfcbfaffcb6d1e95e2acb65403e5db7c849f9221cd
)This shim looks good to go to me. You'll need an official approver to move this along, maybe @steve-mcintyre if you have time? (This is a Debian based shim)
I really went mad looking up and down for the 0003 and 0004 patches :P
Built using gpb's black magic against a github repo fork, and the generated orig tarball matches the mainstream one. I was able to reproduce it it 7859e02e1fc6dff8e2b221dfcbfaffcb6d1e95e2acb65403e5db7c849f9221cd.
Nothing out of the ordinary, looks good to me!
endless-shim-x64-20240912
#8 0.274 7859e02e1fc6dff8e2b221dfcbfaffcb6d1e95e2acb65403e5db7c849f9221cd /shim-review/shimx64.efi
#8 0.277 7859e02e1fc6dff8e2b221dfcbfaffcb6d1e95e2acb65403e5db7c849f9221cd /shim-build/shimx64.efi
Questions
- Is your main CA key also in an HSM or differently?
The CA key is kept on an offline encrypted disk that only a couple people have access to and can decrypt.
- Can you provide a easy way to compare your GRUB2 patches against the Debian package or upstream GRUB2? Mostly interested in that all the CVE patches are applied and what custom modifications are made to GRUB2 that are not packaging/config related
The way we generate the grub source package is kinda unusual. We take all of Debian's patches and apply them directly as commits. Then we add our own changes on top so that we can treat it as a normal git repo instead of using patch files. There are better ways to do that nowadays, but nobody has taken the time to rework our build system.
Anyway, the full set of commits on top of grub 2.06 as of today is here. All of Debian's patches are prefixed with [DEB]
and then ours start after that. This is based on Debian's 2.06-13+deb12u1 version. You can see it in their format here with their patches in particular here.
We haven't added any additional security patches on top of what Debian has done. The main thing we add is the blscfg
module from RedHat. That and a couple other command tweaks allows us to use a fixed grub.cfg
with upgrades managed by ostree.
- Note because you apply the Debian patches, you are going to automatically revoke your old Shim when booting a new one. (should be the same revocation entries as via Windows upates)
Yeah, that should be fine. We don't plan to support rolling back to an earlier shim. The people that need to do something like that can also just change the SBAT policy. Not coincidentally, Windows Update erroneously setting the SBAT policy in our dual boot cases is what spurred getting shim updated.
@THS-on anything else I can provide to answer your questions?
@dbnicholson had a look at the GRUB2 patches and they match the ones that are from Debian and required for SBAT level 4.
Regarding the custom ones:
The rest LGTM
I didn't develop those patches but I agree it would be good to upstream them. I can start an effort to do that. We're usually good about upstreaming our patches for no other reason than it eased our work when upgrading. I don't know why we haven't made an effort with grub. I would guess that at the time most of those were developed, grub upstream was in a different state.
Looks good here with enough positive reviews, marking accepted
Thank you! @THS-on thanks for raising the flag on grub. For next time I hope that patch queue can be much smaller.
Confirm the following are included in your repo, checking each box:
[DEB]
prefix come from Debian's2.06-13+deb12u1
release. All other commits are Endless specific.What is the link to your tag in a repo cloned from rhboot/shim-review?
https://github.com/endlessm/shim-review/releases/tag/endless-shim-x64-20240912
What is the SHA256 hash of your final SHIM binary?
7859e02e1fc6dff8e2b221dfcbfaffcb6d1e95e2acb65403e5db7c849f9221cd
What is the link to your previous shim review request (if any, otherwise N/A)?
https://github.com/rhboot/shim-review/issues/176
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)?
The security contacts have not changed, however I can't find any indication of verification in any previous reviews. Those are:
https://github.com/rhboot/shim-review/issues/176 https://github.com/rhboot/shim-review/issues/105 https://github.com/rhboot/shim-review/issues/61