Commit Graph

326 Commits

Author SHA1 Message Date
Mathieu Trudel-Lapierre
2283f5e85d Unapplying patches to prevent spurious conflicts. 2015-05-06 09:49:30 -04:00
Steve Langasek
3967dc6524 Merge upstream git branch for release 0.7 2015-05-05 23:32:33 +00:00
Steve Langasek
8b0389dd27 Fix the version number; this was uploaded for some reason as -0ubuntu4, not -0ubuntu3. 2015-05-05 08:59:32 -07:00
Steve Langasek
e82e770609 releasing package shim version 0.7-0ubuntu3 2014-10-08 06:41:01 +00:00
Steve Langasek
3586772f0c * SECURITY UPDATE: heap overflow and out-of-bounds read access when
parsing DHCPv6 information
  - debian/patches/CVE-2014-3675.patch: apply proper bounds checking
    when parsing data provided in DHCPv6 packets.
  - CVE-2014-3675
  - CVE-2014-3676
* SECURITY UPDATE: memory corruption when processing user-provided key
  lists
  - debian/patches/CVE-2014-3677.patch: detect malformed machine owner
    key (MOK) lists and ignore them, avoiding possible memory corruption.
  - CVE-2014-3677
2014-10-08 06:40:28 +00:00
Steve Langasek
bc9b5d6386 releasing package shim version 0.7-0ubuntu2 2014-10-07 16:20:10 -07:00
Steve Langasek
4960f3580e Update debian/patches/prototypes with some new declarations needed for
openssl 0.9.8za update.
2014-10-07 16:20:02 -07:00
Steve Langasek
172647da18 Restore debian/patches/prototypes, which still is needed on shim 0.7
but only detected on the buildds.
2014-10-07 09:40:06 -07:00
Steve Langasek
db8383ad9f releasing package shim version 0.7-0ubuntu1 2014-10-07 05:40:45 +00:00
Steve Langasek
1e963007c0 debian/patches/0001-Update-openssl-to-0.9.8za.patch: cherry-pick
openssl 0.9.8za in via upstream.
2014-10-07 05:35:11 +00:00
Steve Langasek
e34fca619d Drop prototypes patch, apparently not needed upstream 2014-10-07 00:30:44 +00:00
Steve Langasek
c61b06bc69 drop most patches, included upstream. 2014-10-07 00:30:39 +00:00
Steve Langasek
59945b252e Merge upstream version 0.7 2014-10-06 17:17:33 -07:00
Steve Langasek
72bb39c023 Import upstream version 0.7 2014-10-06 15:39:48 -07:00
Steve Langasek
5fc0e7f624 releasing package shim version 0.4-0ubuntu5 2014-08-04 12:11:22 +02:00
Peter Jones
6ae4e4f946 Bump version to 0.7.
Do not use 0.6; on some machines it misunderstands the SetupMode
variable.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-11-06 14:07:05 -05:00
Peter Jones
0948ac0971 Fix check logic for SetupMode variable.
After going back and inspecting this further, the logic for "SetupMode"
being present at all was incorrect.  Also initialize our state earlier
so it's sure to always be set.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-11-06 13:59:02 -05:00
Peter Jones
acac338094 Make tag its own make target, and make it sign tags.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-31 11:16:32 -04:00
Peter Jones
b2dd861413 Bump version to 0.6
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-31 11:12:24 -04:00
Peter Jones
6b1f8796ff Don't free GetVariable() return data without checking the status code.
This breaks every machine from before Secure Boot was a thing.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-30 16:36:01 -04:00
Peter Jones
321797142e We should be checking both mok and the system's SB settings
When we call hook_system_services(), we're currently only checking mok's
setting.  We should use secure_mode() instead so it'll check both.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-28 10:41:03 -04:00
Peter Jones
cf718e1940 Revert "additional bounds-checking on section sizes"
This reverts commit 21e40f0174.

In principle I like the idea of what's going on here, but
generate_hash() really does need to have the expected result.
2013-10-23 10:50:36 -04:00
Peter Jones
8044a321f9 Don't reject all binaries without a certificate database.
If a binary isn't signed, but its hash is enrolled in db, it won't have
a certificate database.  So in those cases, don't check it against
certificate databases in db/dbx/etc, but we don't need to reject it
outright.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-22 13:40:08 -04:00
Kees Cook
a0df78b73f additional bounds-checking on section sizes
This adds additional bounds-checking on the section sizes. Also adds
-Wsign-compare to the Makefile and replaces some signed variables with
unsigned counteparts for robustness.

Signed-off-by: Kees Cook <kees@ubuntu.com>
2013-10-22 11:23:51 -04:00
Peter Jones
ee4deae045 Bump version to 0.5
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-04 17:04:21 -04:00
Peter Jones
98a9957866 Unhook system services as we exit.
If we never find a valid thing to boot, we need to undo the weird things
we've done.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-04 15:31:48 -04:00
Peter Jones
29d9c7c327 Put SHIM_VERBOSE under shim's guid, not global.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-04 13:54:35 -04:00
Peter Jones
4ab978a369 Try to actually make debug printing look reasonable.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-04 11:51:09 -04:00
Peter Jones
7de74e6734 Do more strict checking on PE Headers.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-04 11:51:09 -04:00
Matthew Garrett
06caaf44f4 Reapply patches lost in the update 2013-10-04 11:51:09 -04:00
Matthew Garrett
36d13930ee Update to current Tiano Cryptlib 2013-10-04 11:51:09 -04:00
Matthew Garrett
4bf7fb2ef1 Add Tiano patch e98e59c237e17f064a4ecffb39d45499f89720a1
This is:
    Fix a bug in OpensslLib that PKCS7_verify will use over 8k stack space.

    Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
    Reviewed-by: Ye Ting  <ting.ye@intel.com>
    Reviewed-by: Dong Guo <guo.dong@intel.com>

from upstream.
2013-10-04 11:51:09 -04:00
Peter Jones
a3beb2a6f7 Improve PE image bounds checking.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-03 17:04:45 -04:00
Peter Jones
0fb089ee14 Add ident-like blobs to shim.efi for version checking.
I feel dirty.
2013-10-03 11:11:09 -04:00
Peter Jones
c50f5a2d4a Update for Josh's changes.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-02 13:33:52 -04:00
Josh Boyer
47ebeb6262 Add support for disabling db for verification
Provide a mechanism for a physically present end user to disable the use
of db when doing signature verification.  This is handled by the OS passing
down a variable that contains a UINT32 and a SHA256 hash.  If this variable
is present, MokManager prompts the user to choose whether to enable or
disable the use of db for verification purposes (depending on the value of
the UINT32).  They are then asked to type the passphrase that matches the
hash.  This then saves a boot services variable which is checked by shim,
and if set will cause shim to not use db for verification purposes.  If
db is to be ignored, shim will export a runtime variable called
'MokIgnoreDB' for the OS to query at runtime.

Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
2013-10-02 11:29:34 -04:00
Peter Jones
2892db7fda Remove "shim.cer" on "make clean".
If we don't do this, an old key winds up being reused and
MokManager.efi.signed is signed with a different key than shim_cert
reflects.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-02 10:48:41 -04:00
Peter Jones
cb89c25aeb Use CHAR8 not UINT8 for character work.
This gets rid of a lot of type casting that we don't need, and helps
reduce warnings when I switch a bunch of gnu-efi stuff to taking const
arguments.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-02 10:46:26 -04:00
Peter Jones
aed556c4ab CompareMem expects void * and gcc complains.
Sorry about that.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-02 10:02:01 -04:00
Peter Jones
a847e33aaf Fix wrong type on console_error() call.
Stupid L"".

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-02 10:00:11 -04:00
Peter Jones
1d56305945 If we fail to install our protocol, don't continue.
This shouldn't be exploitable unless you've got a way to make
InstallProtocol fail and still, for example, have memory free to
actually load and run something.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-01 16:33:58 -04:00
Peter Jones
7076ec11b0 Clean up warnings.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-01 14:38:09 -04:00
Peter Jones
bb2fe4cfb3 Conditionalize overriding the security policy.
Make OVERRIDE_SECURITY_POLICY a build option.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-01 14:03:16 -04:00
Peter Jones
417077f8de Merge console_control.h and console.h
Since these are topically the same thing, they can live together.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-01 14:03:16 -04:00
Peter Jones
bc71a15ed5 Make verbose stuff use console_notify
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-01 14:03:16 -04:00
Peter Jones
124a3c208e MokManager needs to disable the graphics console.
Without this patch, on some machines we never see MokManager's UI.  This
protocol has never (I think?) been officially published, and yet I still
have new hardware that needs it.

If you're looking for a reference, look at:

EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl/ConsoleControl.c

in the edk2 tree from Tiano.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-01 14:03:16 -04:00
Peter Jones
4185c7d67e Include shim's vendor_cert in MokListRT
There needs to be some way to communicate to the kernel that it's a
trusted key, and since this mechanism already exists, it's by far the
easiest.
2013-10-01 14:03:16 -04:00
Peter Jones
cbef697a96 Harden shim against non-participating bootloaders.
It works like this: during startup of shim, we hook into the system's
ExitBootServices() and StartImage().  If the system's StartImage() is
called, we automatically unhook, because we're chainloading to something
the system can verify.

When shim's verify is called, we record what kind of certificate the
image was verified against.  If the call /succeeds/, we remove our
hooks.

If ExitBootServices() is called, we check how the bootloader verified
whatever it is loading.  If it was verified by its hash, we unhook
everything and call the system's EBS().  If it was verified by
certificate, we check if it has called shim_verify().  If it has, we
unhook everything and call the system's EBS()

If the bootloader has not verified anything, and is itself verified by
a certificate, we display a security violation warning and halt the
machine.
2013-10-01 14:03:16 -04:00
Peter Jones
a1f2863584 Make vendor_cert/vendor_dbx actually replaceable by an external tool.
This moves them both to be computed at runtime from a pointer+offset
rather than just a pointer, so that their real address can be entirely
derived from the section they're in.

This means you can replace the whole .vendor_cert section with a new one
with certs that don't have the same size.
2013-10-01 14:03:16 -04:00
Peter Jones
2efb269ba6 Remove TODO items fixed by merging lf_merge and lcp/lf-security-override.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-10-01 14:03:16 -04:00