Skip to content
UEFI shim loader
C C++ Other
Branch: master
Clone or download
vathpela Once again, try even harder to get binaries without timestamps in them.
$ objdump -x /builddir/build/BUILDROOT/shim-*/usr/share/shim/*/shimx64.efi | grep 'Time/Date'
Time/Date		Thu Jan  1 00:00:08 1970
$ _

"What is despair? I have known it—hear my song. Despair is when you’re
debugging a kernel driver and you look at a memory dump and you see that
a pointer has a value of 7."
 - http://scholar.harvard.edu/files/mickens/files/thenightwatch.pdf

objcopy only knows about -D for some targets.
ld only believes in --no-insert-timestamp in some versions.
dd takes off and nukes the site from orbit.

It's the only way to be sure.

Signed-off-by: Peter Jones <pjones@redhat.com>
Latest commit a4a1fbe Mar 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Cryptlib Cryptlib: fix build on 32bit ARM Jan 31, 2019
include console: Move the countdown function to console.c Jan 31, 2019
lib
.gitignore Ignore *.hash Jan 31, 2019
.travis.yml Update travis to use some better build scripts Apr 11, 2018
BUILDING Fix typo Jul 18, 2018
COPYRIGHT Add copyright file Jul 9, 2012
Make.coverity Add 'make coverity' target. Mar 12, 2018
Make.defaults Once again, try even harder to get binaries without timestamps in them. Mar 15, 2019
Make.rules Add 'make coverity' target. Mar 12, 2018
Make.scan-build Work around clang bugs for scan-build. Mar 15, 2018
Makefile Once again, try even harder to get binaries without timestamps in them. Mar 15, 2019
MokManager.c console: Move the countdown function to console.c Jan 31, 2019
MokVars.txt Add MokListX to MokVars.txt Aug 3, 2017
PasswordCrypt.c shim: Use EFI_ERROR() instead of comparing to EFI_SUCCESS everywhere. Mar 12, 2018
README README: Remove superfluous *and* Jul 18, 2018
README.fallback README.fallback: correct the path of BOOT.CSV in layout example Jul 24, 2017
README.tpm Add GRUB's PCR Usage to README.tpm Aug 1, 2018
TODO Add mm/fb hashing to TODO, put that and related things under 'Reprodu… Aug 21, 2018
buildid.c buildid: Check the return values of write() calls Sep 29, 2017
cert.S
crypt_blowfish.c
elf_aarch64_efi.lds Don't allow anything with a small alignment in our PE files. Apr 27, 2017
elf_arm_efi.lds Don't allow anything with a small alignment in our PE files. Apr 27, 2017
elf_ia32_efi.lds Don't allow anything with a small alignment in our PE files. Apr 27, 2017
elf_ia64_efi.lds Make shim_version live in a special aligned section. Feb 23, 2017
elf_x86_64_efi.lds Don't allow anything with a small alignment in our PE files. Apr 27, 2017
errlog.c VLogError(): Avoid NULL pointer dereferences in (V)Sprint calls Mar 8, 2019
fallback.c fallback: show a countdown menu before reset Jan 31, 2019
httpboot.c httpboot: show the error message for the ChildHandle Jul 18, 2018
make-certs Sign MokManager with a locally-generated key Nov 26, 2012
model.c Add a model file for coverity. Mar 12, 2018
mok.c mok: fix missing closing brace in maybe_mirror_one_mok_variable Feb 20, 2019
netboot.c console: Add console_print and console_print_at helpers Mar 12, 2018
replacements.c console: Add console_print and console_print_at helpers Mar 12, 2018
shim.c Make EFI variable copying fatal only on secureboot enabled systems Jan 31, 2019
shim.h shim: only include shim_cert.h in shim.c Jan 31, 2019
testplan.txt Another testplan error. Oct 2, 2014
tpm.c Remove call to TPM2 get_event_log() Jan 31, 2019
version.c.in Make shim_version live in a special aligned section. Feb 23, 2017
version.h Add ident-like blobs to shim.efi for version checking. Oct 3, 2013

README

shim is a trivial EFI application that, when run, attempts to open and
execute another application. It will initially attempt to do this via the
standard EFI LoadImage() and StartImage() calls. If these fail (because secure
boot is enabled and the binary is not signed with an appropriate key, for
instance) it will then validate the binary against a built-in certificate. If
this succeeds and if the binary or signing key are not blacklisted then shim
will relocate and execute the binary.

shim will also install a protocol which permits the second-stage bootloader
to perform similar binary validation. This protocol has a GUID as described
in the shim.h header file and provides a single entry point. On 64-bit systems
this entry point expects to be called with SysV ABI rather than MSABI, so calls
to it should not be wrapped.

On systems with a TPM chip enabled and supported by the system firmware,
shim will extend various PCRs with the digests of the targets it is
loading.  A full list is in the file README.tpm .

To use shim, simply place a DER-encoded public certificate in a file such as
pub.cer and build with "make VENDOR_CERT_FILE=pub.cer".

There are a couple of build options, and a couple of ways to customize the
build, described in BUILDING.
You can’t perform that action at this time.