summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-04-25Merge pull request #10 from endlessm/T16731archive/v0.9-endlessRelease_3.5.9Release_3.5.8Release_3.5.7Release_3.5.6Release_3.5.5Release_3.5.4Release_3.5.3Release_3.5.2Release_3.5.1Release_3.5.0Release_3.4.8Release_3.4.7Release_3.4.6Release_3.4.5Release_3.4.4Release_3.4.3Release_3.4.2Release_3.4.1Release_3.4.0Release_3.3.9Release_3.3.8Release_3.3.7Release_3.3.6Release_3.3.5Release_3.3.4Release_3.3.3Release_3.3.2Release_3.3.18Release_3.3.17Release_3.3.16Release_3.3.15Release_3.3.14Release_3.3.13Release_3.3.12Release_3.3.11Release_3.3.10Release_3.3.1Release_3.3.0Release_3.2.6Release_3.2.5Release_3.2.4Release_3.2.3Release_3.2.2Release_3.2.1Release_3.2.0Release_3.1.8Release_3.1.7Release_3.1.6Daniel Drake
fallback: Avoid duplicates in BootOrder
2017-04-25fallback: Avoid duplicates in BootOrderJoão Paulo Rechi Vita
When fallback re-uses a duplicate entry, it is likely that it is already listed in BootOrder. In this case the re-used entry should not be copied from the old BootOrder, and the new BootOrder size needs to be adjusted accordingly. Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com> https://phabricator.endlessm.com/T16731
2017-02-21Merge pull request #9 from endlessm/T15481Release_3.1.5Release_3.1.4Release_3.1.3Daniel Drake
fallback: Consider all Boot* vars when checking for duplicates
2017-02-21fallback: Consider all Boot* vars when checking for duplicatesJoão Paulo Rechi Vita
Some firmware implementations like the one on the Acer TravelMate P449-G2-MG completely ignore the contents of BootOrder on boot, and overwrite it with a value of its own. On this particular machine, the boot entry that was just created by fallback on the previous boot is not included by the firmware on this new BootOrder, so it is not considered when checking for duplicates. This problem is agravated by the fact that the aformentioned firmware does not give the user the possibility to boot from the entry created by fallback (or any other entry created by the OS). The only way to boot a distro that deploys the fallback setup (no grub inside \EFI\BOOT) with this firmware is to select the entry pointing to \EFI\BOOT\bootx64.efi, leading to a new boot entry being created by fallback on every boot. This commit makes fallback try every Boot* variable when checking for duplicates, working around this problem. Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com> https://phabricator.endlessm.com/T15481
2017-01-06Merge pull request #8 from endlessm/T14430-singleentryRelease_3.1.2Release_3.1.1Release_3.1.0-rc1Release_3.1.0Will Thompson
fallback: replace any existing boot entry with the same name
2017-01-05fallback: replace any existing boot entry with the same nameDaniel Drake
Tweak the dupliate boot entry detection code to consider any existing entries as duplicate if they have the same name (rather than requiring the existing entry to be completely identical to the one we would add). When a duplicate is detected, rewrite the whole variable (as the device details might have changed) in addition to making it the new default boot entry. This means that when partition UUIDs are changed, or when doing a fresh reflash, we will avoid creating duplicate entries with the same name. https://phabricator.endlessm.com/T14430
2016-09-26Merge pull request #6 from endlessm/T13374-noiseDaniel Drake
fallback: Reduce noise when BootOrder list is empty
2016-09-26fallback: Reduce noise when BootOrder list is emptyCarlo Caione
Signed-off-by: Carlo Caione <carlo@endlessm.com>
2016-07-18Don't close file twice in should_use_fallback error pathRelease_3.0.9Release_3.0.8Release_3.0.7Release_3.0.6Release_3.0.5Release_3.0.4Release_3.0.3Release_3.0.2Release_3.0.11Release_3.0.10Release_3.0.1Release_3.0.0Benjamin Antin
When fallback.efi is not present, the should_use_fallback error path attempts to close a file that has already been closed, resulting in a hang. This issue only affects certain systems. This is a regression from version 0.8 and was introduced by commit 4794822. Signed-off-by: Benjamin Antin <ben.antin@endlessm.com>
2016-06-30makefile: Fix detecting objcopy versionRelease_3.0.0-rc3Release_3.0.0-rc1Carlo Caione
Signed-off-by: Carlo Caione <carlo@endlessm.com>
2016-06-30shim: Fix unused variable errorCarlo Caione
Signed-off-by: Carlo Caione <carlo@endlessm.com>
2016-06-30Sign MokManager with sbsigntool instead of pesignSteve Langasek
Ubuntu infrastructure uses sbsigntool for all other EFI signing, so we use the same thing for signing MokManager with our ephemeral key. This also avoids an additional build dependency on libnss3-tools.
2016-06-30Chainload grubx64.efi, not grub.efiSteve Langasek
We qualify the second stage bootloader image with the architecture name, so we're forwards-compatible with any future 32-bit implementations. (Non-SB grub doesn't conflict, since the image will be named bootia32.efi anyway, not grub.efi.)
2016-06-09shim: make the PE loader less overzealous on rejectionsPeter Jones
2016-05-18Work around binutils version string weirdness.Peter Jones
Nick Clifton wrote to me and explained: Subject: SHIM - objcopy version check broken by RHEL 7.3 binutils Hi Peter, We (the tools group) have run across a small problem with the shim package for RHEL 7.3, whilst testing out a new version of the binutils. It complains that it needs a version of objcopy that is >= 2.23, despite the fact that the version is actually 2.25.1. I tracked the problem down to an extraneous space at the end of the version string being produced by objcopy: "GNU objcopy version 2.25.1-8.el7 " The Makefile in the shim package uses this rule to test the version of objcopy: OBJCOPY_GTE224 = $(shell expr `$(OBJCOPY) --version |grep ^"GNU objcopy" | sed 's/^.* //g' | cut -f1-2 -d.` \>= 2.24) But, because of that extra space, the sed expression clips the entire line and so the test fails. The extra space is there because normally the version number would be followed by a date. For example: "GNU objcopy version 2.23.52.0.1-56.el7 20130226" So in this case the sed will extract the date, not the version number, but the test will still pass. I could fix the binutils to remove the space, although it would be a bit messy and it would not fix the problem when a date is appended to the version number. Instead, I would like to propose a small patch to the shim Makefile. If you change the line to: OBJCOPY_GTE224 = $(shell expr `$(OBJCOPY) --version |grep ^"GNU objcopy" | sed 's/^.version //g' | cut -f1-2 -d.` \>= 2.24) then the test will work as intended, with or without an extra space at the end of the version and with or without a date appended. Would it be possible to have this change added to the shim package ? Cheers Signed-off-by: Peter Jones <pjones@redhat.com>
2016-05-11Measure state and second stage into TPMMatthew Garrett
Add support for measuring the MOK database and secure boot state into a TPM, and do the same for the second stage loader. This avoids a hole in TPM measurement between the firmware and the second stage loader.
2016-05-11shim: dealing with only one string on loadoptionIvan Hu
The second stage set is not working after commit 3322257e611e2000f79726d295bb4845bbe449e7 for those which load option only have one string. Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
2016-03-22shim: mirror MokSBState in runtime so the kernel can make use of it.Mathieu Trudel-Lapierre
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2015-11-17Don't test for the 0 character on the wrong half of the UCS2-LE char.Peter Jones
Signed-off-by: Peter Jones <pjones@redhat.com>
2015-11-17shim: check for EFI\BOOT\BOOT${ARCH}.EFI as well as the leading \ versionPeter Jones
I found a machine whose BDS gives us relative paths, yay! The rest of the code still works without that leading slash, so just make it one more item we let through our StrnCaseCmp() filter. Signed-off-by: Peter Jones <pjones@redhat.com>
2015-11-17shim: fix resource leak on should_use_fallback() error pathPeter Jones
ExitBootServices() and Exit() should both clean these up anyway, but we should do the right thing nonetheless. Signed-off-by: Peter Jones <pjones@redhat.com>
2015-11-17shim: rebuild shim.o if headers changePeter Jones
Signed-off-by: Peter Jones <pjones@redhat.com>
2015-11-17shim: if generate_path() gets a full path, just return it.Peter Jones
We decide if it's a full path by if it starts with \\EFI\\. That's quite lazy, but we can't just check \\ like you'd hope, because we need to stay compatible with what we've set as DEFAULT_LOADER in the past, and I don't feel like writing the full path traversal file test. Signed-off-by: Peter Jones <pjones@redhat.com>
2015-11-17shim: fix a wrong-abi call to Stall() and ResetSystem()Peter Jones
Woops. The net outcome of these is going to be a sleep of unknown duration, followed by either a) ResetSystem() with some random selection of warm/cold boot, or b) ResetSystem() returning an error and shim returning error from efi_main(). Signed-off-by: Peter Jones <pjones@redhat.com>
2015-11-17shim: handle BDS's li->LoadOptions and Shell's li->LoadOptions .Peter Jones
Load options are a giant pain in the ass, because the shell is a giant piece of junk. If we're invoked from the EFI shell, we get something like this: 00000000 5c 00 45 00 36 00 49 00 5c 00 66 00 65 00 64 00 |\.E.F.I.\.f.e.d.| 00000010 6f 00 72 00 61 00 5c 00 73 00 68 00 69 00 6d 00 |o.r.a.\.s.h.i.m.| 00000020 78 00 36 00 34 00 2e 00 64 00 66 00 69 00 20 00 |x.6.4...e.f.i. .| 00000030 5c 00 45 00 46 00 49 00 5c 00 66 00 65 00 64 00 |\.E.F.I.\.f.e.d.| 00000040 6f 00 72 00 61 00 5c 00 66 00 77 00 75 00 70 00 |o.r.a.\.f.w.u.p.| 00000050 64 00 61 00 74 00 65 00 2e 00 65 00 66 00 20 00 |d.a.t.e.e.f.i. .| 00000060 00 00 66 00 73 00 30 00 3a 00 5c 00 00 00 |..f.s.0.:.\...| which is just some paths rammed together separated by a UCS-2 NUL. But if we're invoked from BDS, we get something more like: 00000000 01 00 00 00 62 00 4c 00 69 00 6e 00 75 00 78 00 |....b.L.i.n.u.x.| 00000010 20 00 46 00 69 00 72 00 6d 00 77 00 61 00 72 00 | .F.i.r.m.w.a.r.| 00000020 65 00 20 00 55 00 70 00 64 00 61 00 74 00 65 00 |e. .U.p.d.a.t.e.| 00000030 72 00 00 00 40 01 2a 00 01 00 00 00 00 08 00 00 |r.....*.........| 00000040 00 00 00 00 00 40 06 00 00 00 00 00 1a 9e 55 bf |.....@........U.| 00000050 04 57 f2 4f b4 4a ed 26 4a 40 6a 94 02 02 04 04 |.W.O.:.&J@j.....| 00000060 34 00 5c 00 45 00 46 00 49 00 5c 00 66 00 65 00 |4.\.E.F.I.f.e.d.| 00000070 64 00 6f 00 72 00 61 00 5c 00 73 00 68 00 69 00 |o.r.a.\.s.h.i.m.| 00000080 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 |x.6.4...e.f.i...| 00000090 00 00 7f ff 40 00 20 00 5c 00 66 00 77 00 75 00 |...... .\.f.w.u.| 000000a0 70 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 |p.x.6.4...e.f.i.| 000000b0 00 00 |..| which is clearly an EFI_LOAD_OPTION filled in halfway reasonably. In short, the UEFI shell is still a useless piece of junk. So anyway, try to determine which one we've got and handle it appropriately. Signed-off-by: Peter Jones <pjones@redhat.com>
2015-11-17Add a utility hexdump() call we can use when we need it.Peter Jones
This is mostly for debugging, so it's not a real problem if it's not used right now. I just like having it handy. Signed-off-by: Peter Jones <pjones@redhat.com>
2015-11-17MokManager: Fix a -Wsign-compare bug on i?86Peter Jones
My favorite part of -Wsign-compare is how it shows different results on different arches for no obvious reason. Signed-off-by: Peter Jones <pjones@redhat.com>
2015-11-17Fix unsigned int overflow on our i386 debug hook test.Peter Jones
Signed-off-by: Peter Jones <pjones@redhat.com>
2015-11-09Cryptlib: Define the va functions for EFIAPIGary Ching-Pang Lin
It turned out that my previous crash fix(*) was wrong. We actually always used the gcc built-in va functions instead of the "real" va functions for EFIAPI, and we are just lucky that ERR_add_error_data didn't crash before. This commit copies the va functions from MdePkg/Include/Base.h in edk2 and introdues NO_BUILTIN_VA_FUNCS for x86_64, so that all the x86_64 build will adopt the new va functions. For safety, I also added EFIAPI to all the functions which use va_* to avoid the potential trouble. (*) a7f4b26cc35204165bd04e75c34e8e7aa2a87ecc Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2015-09-18Fix recursive reference for RELEASELinn Crosetto
Building 0.9 with GNU Make 4.0 fails with the following error: Makefile:4: *** Recursive variable 'RELEASE' references itself (eventually). Stop. Change RELEASE to simply-expanded. Signed-off-by: Linn Crosetto <linn@hpe.com>
2015-07-28Specify the gnu89 standardGary Ching-Pang Lin
According to the gcc5 porting guideline (*), gcc5 defaults to -std=gnu11 instead of -std=gnu89. Append -std=gnu89 to CFLAGS to avoid the potential problems. (*) https://gcc.gnu.org/gcc-5/porting_to.html Based on the patch from Cristian Rodriguez <crrodriguez@opensuse.org> Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2015-07-28Openssl: Add EFIAPI for ERR_add_error_vdataGary Ching-Pang Lin
Without declaring EFIAPI for ERR_add_error_vdata, shim would crash while verifying the loaded image. Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2015-07-28Update openssl to 1.0.2dGary Ching-Pang Lin
Also update Cryptlib to edk2 r17731 Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2015-06-30Typo on aarch64 :/Peter Jones
Signed-off-by: Peter Jones <pjones@redhat.com>
2015-06-300.9Version_0.90.9Peter Jones
Signed-off-by: Peter Jones <pjones@redhat.com>
2015-06-30Improve our debuginfo path printPeter Jones
Signed-off-by: Peter Jones <pjones@redhat.com>
2015-06-29Make sure our build-id notes wind up at a reasonable place.Peter Jones
Signed-off-by: Peter Jones <pjones@redhat.com>
2015-06-29Only be verbose the first time secure_mode() is called.Peter Jones
It's annoying to find out we're not in SB mode over and over. Really it is. Signed-off-by: Peter Jones <pjones@redhat.com>
2015-06-29Add a conditional point for a debugger to attach.Peter Jones
Signed-off-by: Peter Jones <pjones@redhat.com>
2015-06-29More incorrect unsigned vs signed fixups from yours truly.Peter Jones
Woops. Signed-off-by: Peter Jones <pjones@redhat.com>
2015-06-29Don't print anything or delay when start_image() succeeds.Peter Jones
Signed-off-by: Peter Jones <pjones@redhat.com>
2015-06-16MokManager: Nerf SHA-1 again for actual hashes and signatures.Peter Jones
Nobody should be deploying SHA-1. No hardware deploys it, and the rate of change on https://en.wikipedia.org/wiki/SHA-1#Attacks is wildly uninspiring. Signed-off-by: Peter Jones <pjones@redhat.com>
2015-06-16MokManager: fix comparison between signed and unsigned integerGary Ching-Pang Lin
Patch from Johannes Segitz <jsegitz@suse.com>
2015-06-16MokManager: Discard the list contains an invalid signatureGary Ching-Pang Lin
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2015-06-16MokManager: Support SHA224, SHA384, and SHA512Gary Ching-Pang Lin
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2015-06-16MokManager: Add more key list safe checksGary Ching-Pang Lin
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2015-06-16MokManager: fix the return value and typeGary Ching-Pang Lin
There are some functions that the return value and the type didn't match. Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2015-06-16MokManager: Support SHA1 hash in MOKGary Ching-Pang Lin
Add SHA1 hash support and amend the code to make it easier to support other SHA digests.
2015-06-16MokManager: fix the hash list counting in deleteGary Ching-Pang Lin
match_hash() requests the number of keys in a list and it was mistakenly replaced with the size of the Mok node. This would made MokManager to remove the whole Mok node instead of one hash. Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2015-06-16MokManager: calculate the variable size correctlyGary Ching-Pang Lin
MokSize of the hash signature list includes the owner GUID, so we should not add the 16bytes compensation. Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>