All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add support for signing grub with an appended signature
@ 2020-10-16 11:20 Michal Suchánek
       [not found] ` <871rhuwi80.fsf@dja-thinkpad.axtens.net>
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Suchánek @ 2020-10-16 11:20 UTC (permalink / raw)
  To: dja, grub-devel

Hello,

It has been pointed out in the plumbers session that the ELF note will
cause problems when user wants to add additional signature.

The normal appended signature has only one size information - in the
footer at the end of the binary, and that is not part of the signed
data. So if you want to add additional signature it if possible to
expand the room for the signature data.

In contrast the ELF note size is present in the ELF header which is
also signed. This does not allow adjusting the size of the signature
data once the binary is signed.

A simpler scheme would be for grub-install to parse the signature
footer, split-off the signature, write the ELF binary at the start of
the PReP partition, and the signature at the end. Then the grub
signature can use exactly same format as the kernel and modules.

The disadvantage is that for signed grub dd is no longer an alternative
to grub-install.

There was also concern about distinguishing signed and un-signed grub.
That is that writing an un-signed grub might lease a stale signature
leading to an error.

However, secure boot is something that should be enabled or disabled in
firmware settings, and not triggered by the PPeP partition containing a
signature. 

When secure boot is enabled checking the grub signature is required and
un-signed grub is invalid. When secure boot is disabled the signature
is irrelevant and stale signature should not cause any error.

grub-install can also remove the signature magic when installing
un-signed grub for consistency. Users using dd to install un-signed
grub might still have an old signature at the end of the partition.

Thanks

Michal


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH 0/3] Add support for signing grub with an appended signature
@ 2020-08-21  2:37 Daniel Axtens
  2020-09-23 15:11 ` Daniel Axtens
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Axtens @ 2020-08-21  2:37 UTC (permalink / raw)
  To: grub-devel; +Cc: rashmica.g, alastair, Daniel Axtens

Part of a secure boot chain is allowing boot firmware to verify the
grub core.img. For UEFI platforms, this is done by signing the PE
binary with a tool like pesign or sb-sign. However, for platforms that
don't implement UEFI, an alternative scheme is required.

These patches provide some infrastructure and documentation for
signing grub's core.img with a Linux-kernel-module style appended
signature.

Because some platforms, such as powerpc-ieee1275, load grub from a raw
disk partition rather than a filesystem, we extend grub-install to add
an ELF note that allows us to specify the size and location of the
signature.

More details are in patch 1, including a link to an open-source firmware
capable of verifying a grub image signed this way.

Daniel Axtens (2):
  docs/grub: Document signing grub under UEFI
  docs/grub: Document signing grub with an appended signature

Rashmica Gupta (1):
  Add suport for signing grub with an appended signature

 docs/grub.texi              | 64 ++++++++++++++++++++++++++++++++++++-
 include/grub/util/install.h |  8 +++--
 include/grub/util/mkimage.h |  4 +--
 util/grub-install-common.c  | 16 ++++++++--
 util/grub-mkimage.c         | 11 +++++++
 util/grub-mkimagexx.c       | 39 +++++++++++++++++++++-
 util/mkimage.c              | 10 +++---
 7 files changed, 138 insertions(+), 14 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-11-04 18:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 11:20 [PATCH 0/3] Add support for signing grub with an appended signature Michal Suchánek
     [not found] ` <871rhuwi80.fsf@dja-thinkpad.axtens.net>
2020-10-19 23:18   ` Daniel Axtens
2020-10-22  4:25   ` Daniel Axtens
2020-10-22 11:14     ` Michal Suchánek
2020-10-23  5:33       ` Daniel Axtens
2020-11-04 18:04         ` Michal Suchánek
  -- strict thread matches above, loose matches on Subject: below --
2020-08-21  2:37 Daniel Axtens
2020-09-23 15:11 ` Daniel Axtens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.