All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Add chainloaded image as shim's verifiable object
@ 2021-03-05 13:48 Michael Chang
  2021-03-09 16:18 ` Daniel Kiper
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Chang @ 2021-03-05 13:48 UTC (permalink / raw)
  To: The development of GNU GRUB

While attempting to dual boot Microsoft Windows with efi chainloader, it
failed with below error when secure boot was enabled.

error ../../grub-core/kern/verifiers.c:119:verification requested but
nobody cares: /EFI/Microsoft/Boot/bootmgfw.efi.

It is a regression, as previously it worked without problem.

It turns out chainloading image has been locked down introduced by

578c95298 kern: Add lockdown support

However we should consider it as verifiable object to shim to allow
booting in secure boot enabled mode. The chainloaded image could also
have trusted signature signed by vendor with their pubkey cert in db.
For that matters it's usage should not be locked down in secure boot,
and instead use shim to validate it's signature before running it.

V2:
Keep GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE in the lockdown list as it
ensures at least one verifer has validated the image.

Signed-off-by: Michael Chang <mchang@suse.com>
---
 grub-core/kern/efi/sb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/grub-core/kern/efi/sb.c b/grub-core/kern/efi/sb.c
index 41dadcd14..96d237722 100644
--- a/grub-core/kern/efi/sb.c
+++ b/grub-core/kern/efi/sb.c
@@ -129,6 +129,7 @@ shim_lock_verifier_init (grub_file_t io __attribute__ ((unused)),
     case GRUB_FILE_TYPE_BSD_KERNEL:
     case GRUB_FILE_TYPE_XNU_KERNEL:
     case GRUB_FILE_TYPE_PLAN9_KERNEL:
+    case GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE:
       *flags = GRUB_VERIFY_FLAGS_SINGLE_CHUNK;
 
       /* Fall through. */
-- 
2.26.2



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

* Re: [PATCH v2] Add chainloaded image as shim's verifiable object
  2021-03-05 13:48 [PATCH v2] Add chainloaded image as shim's verifiable object Michael Chang
@ 2021-03-09 16:18 ` Daniel Kiper
  2021-03-10  3:56   ` Michael Chang
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Kiper @ 2021-03-09 16:18 UTC (permalink / raw)
  To: mchang; +Cc: grub-devel, dimitri.ledkov, javierm, thomas.frauendorfer

On Fri, Mar 05, 2021 at 09:48:53PM +0800, Michael Chang via Grub-devel wrote:
> While attempting to dual boot Microsoft Windows with efi chainloader, it
> failed with below error when secure boot was enabled.
>
> error ../../grub-core/kern/verifiers.c:119:verification requested but
> nobody cares: /EFI/Microsoft/Boot/bootmgfw.efi.
>
> It is a regression, as previously it worked without problem.
>
> It turns out chainloading image has been locked down introduced by
>
> 578c95298 kern: Add lockdown support
>
> However we should consider it as verifiable object to shim to allow
> booting in secure boot enabled mode. The chainloaded image could also
> have trusted signature signed by vendor with their pubkey cert in db.
> For that matters it's usage should not be locked down in secure boot,
> and instead use shim to validate it's signature before running it.
>
> V2:
> Keep GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE in the lockdown list as it
> ensures at least one verifer has validated the image.
>
> Signed-off-by: Michael Chang <mchang@suse.com>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel


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

* Re: [PATCH v2] Add chainloaded image as shim's verifiable object
  2021-03-09 16:18 ` Daniel Kiper
@ 2021-03-10  3:56   ` Michael Chang
  2021-03-10 16:06     ` IS: 2.06-rc1 cut... WAS: " Daniel Kiper
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Chang @ 2021-03-10  3:56 UTC (permalink / raw)
  To: Daniel Kiper; +Cc: grub-devel, dimitri.ledkov, javierm, thomas.frauendorfer

On Tue, Mar 09, 2021 at 05:18:22PM +0100, Daniel Kiper wrote:
> On Fri, Mar 05, 2021 at 09:48:53PM +0800, Michael Chang via Grub-devel wrote:
> > While attempting to dual boot Microsoft Windows with efi chainloader, it
> > failed with below error when secure boot was enabled.
> >
> > error ../../grub-core/kern/verifiers.c:119:verification requested but
> > nobody cares: /EFI/Microsoft/Boot/bootmgfw.efi.
> >
> > It is a regression, as previously it worked without problem.
> >
> > It turns out chainloading image has been locked down introduced by
> >
> > 578c95298 kern: Add lockdown support
> >
> > However we should consider it as verifiable object to shim to allow
> > booting in secure boot enabled mode. The chainloaded image could also
> > have trusted signature signed by vendor with their pubkey cert in db.
> > For that matters it's usage should not be locked down in secure boot,
> > and instead use shim to validate it's signature before running it.
> >
> > V2:
> > Keep GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE in the lockdown list as it
> > ensures at least one verifer has validated the image.
> >
> > Signed-off-by: Michael Chang <mchang@suse.com>
> 
> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

May I ask if the patch is planned or going to be merged to the master
hence available in the 2.06-rc1 cut ?

Thanks,
Michael

> 
> Daniel
> 



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

* IS: 2.06-rc1 cut... WAS: Re: [PATCH v2] Add chainloaded image as shim's verifiable object
  2021-03-10  3:56   ` Michael Chang
@ 2021-03-10 16:06     ` Daniel Kiper
  2021-03-10 18:50       ` Didier Spaier
  2021-03-11  5:56       ` Michael Chang
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Kiper @ 2021-03-10 16:06 UTC (permalink / raw)
  To: Michael Chang; +Cc: grub-devel, dimitri.ledkov, javierm, thomas.frauendorfer

On Wed, Mar 10, 2021 at 11:56:47AM +0800, Michael Chang via Grub-devel wrote:
> On Tue, Mar 09, 2021 at 05:18:22PM +0100, Daniel Kiper wrote:
> > On Fri, Mar 05, 2021 at 09:48:53PM +0800, Michael Chang via Grub-devel wrote:
> > > While attempting to dual boot Microsoft Windows with efi chainloader, it
> > > failed with below error when secure boot was enabled.
> > >
> > > error ../../grub-core/kern/verifiers.c:119:verification requested but
> > > nobody cares: /EFI/Microsoft/Boot/bootmgfw.efi.
> > >
> > > It is a regression, as previously it worked without problem.
> > >
> > > It turns out chainloading image has been locked down introduced by
> > >
> > > 578c95298 kern: Add lockdown support
> > >
> > > However we should consider it as verifiable object to shim to allow
> > > booting in secure boot enabled mode. The chainloaded image could also
> > > have trusted signature signed by vendor with their pubkey cert in db.
> > > For that matters it's usage should not be locked down in secure boot,
> > > and instead use shim to validate it's signature before running it.
> > >
> > > V2:
> > > Keep GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE in the lockdown list as it
> > > ensures at least one verifer has validated the image.
> > >
> > > Signed-off-by: Michael Chang <mchang@suse.com>
> >
> > Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
>
> May I ask if the patch is planned or going to be merged to the master
> hence available in the 2.06-rc1 cut ?

I have just pushed it together with other fixes and cleanups from the
grub-devel. If you can see something important missing drop me a line
immediately. Now I am working on 2.06-rc1 cut. If nothing blows up expect
it tomorrow or on Friday...

Daniel


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

* Re: IS: 2.06-rc1 cut... WAS: Re: [PATCH v2] Add chainloaded image as shim's verifiable object
  2021-03-10 16:06     ` IS: 2.06-rc1 cut... WAS: " Daniel Kiper
@ 2021-03-10 18:50       ` Didier Spaier
  2021-03-11  5:56       ` Michael Chang
  1 sibling, 0 replies; 6+ messages in thread
From: Didier Spaier @ 2021-03-10 18:50 UTC (permalink / raw)
  To: grub-devel

Le 10/03/2021 à 17:06, Daniel Kiper a écrit :
> I have just pushed it together with other fixes and cleanups from the
> grub-devel. If you can see something important missing drop me a line
> immediately. Now I am working on 2.06-rc1 cut. If nothing blows up expect
> it tomorrow or on Friday...

A least the disable-os-probing stuff works as expected, as far as I can
tell.

Didier


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

* Re: IS: 2.06-rc1 cut... WAS: Re: [PATCH v2] Add chainloaded image as shim's verifiable object
  2021-03-10 16:06     ` IS: 2.06-rc1 cut... WAS: " Daniel Kiper
  2021-03-10 18:50       ` Didier Spaier
@ 2021-03-11  5:56       ` Michael Chang
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Chang @ 2021-03-11  5:56 UTC (permalink / raw)
  To: Daniel Kiper; +Cc: grub-devel, dimitri.ledkov, javierm, thomas.frauendorfer

On Wed, Mar 10, 2021 at 05:06:31PM +0100, Daniel Kiper wrote:
> On Wed, Mar 10, 2021 at 11:56:47AM +0800, Michael Chang via Grub-devel wrote:
> > On Tue, Mar 09, 2021 at 05:18:22PM +0100, Daniel Kiper wrote:
> > > On Fri, Mar 05, 2021 at 09:48:53PM +0800, Michael Chang via Grub-devel wrote:
> > > > While attempting to dual boot Microsoft Windows with efi chainloader, it
> > > > failed with below error when secure boot was enabled.
> > > >
> > > > error ../../grub-core/kern/verifiers.c:119:verification requested but
> > > > nobody cares: /EFI/Microsoft/Boot/bootmgfw.efi.
> > > >
> > > > It is a regression, as previously it worked without problem.
> > > >
> > > > It turns out chainloading image has been locked down introduced by
> > > >
> > > > 578c95298 kern: Add lockdown support
> > > >
> > > > However we should consider it as verifiable object to shim to allow
> > > > booting in secure boot enabled mode. The chainloaded image could also
> > > > have trusted signature signed by vendor with their pubkey cert in db.
> > > > For that matters it's usage should not be locked down in secure boot,
> > > > and instead use shim to validate it's signature before running it.
> > > >
> > > > V2:
> > > > Keep GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE in the lockdown list as it
> > > > ensures at least one verifer has validated the image.
> > > >
> > > > Signed-off-by: Michael Chang <mchang@suse.com>
> > >
> > > Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
> >
> > May I ask if the patch is planned or going to be merged to the master
> > hence available in the 2.06-rc1 cut ?
> 
> I have just pushed it together with other fixes and cleanups from the
> grub-devel. If you can see something important missing drop me a line
> immediately. Now I am working on 2.06-rc1 cut. If nothing blows up expect
> it tomorrow or on Friday...

Many thanks to picking up the patch. Tested the efi chainloader now
could successfully load and start the signed uefi binary, meanwhile
reject the one with invalid signature in secure boot enabled mode. This
function is restored.

Thanks,
Michael

> 
> Daniel
> 



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

end of thread, other threads:[~2021-03-11  5:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 13:48 [PATCH v2] Add chainloaded image as shim's verifiable object Michael Chang
2021-03-09 16:18 ` Daniel Kiper
2021-03-10  3:56   ` Michael Chang
2021-03-10 16:06     ` IS: 2.06-rc1 cut... WAS: " Daniel Kiper
2021-03-10 18:50       ` Didier Spaier
2021-03-11  5:56       ` Michael Chang

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.