Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1570820 > unrolled thread

[PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]

Started byDavid Howells <dhowells@redhat.com>
First post2017-01-31 16:20 +0100
Last post2017-02-03 17:30 +0100
Articles 9 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch()  [ver #7] David Howells <dhowells@redhat.com> - 2017-01-31 16:20 +0100
    Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch()  [ver #7] Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-02-03 17:10 +0100
      Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7] David Howells <dhowells@redhat.com> - 2017-02-03 17:30 +0100
        Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch()  [ver #7] Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-02-03 17:30 +0100
          Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch()  [ver #7] Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-02-03 18:10 +0100
            Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7] David Howells <dhowells@redhat.com> - 2017-02-03 18:20 +0100
      Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch()  [ver #7] Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-02-03 17:30 +0100
        Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7] David Howells <dhowells@redhat.com> - 2017-02-03 17:30 +0100
      Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7] David Howells <dhowells@redhat.com> - 2017-02-03 17:30 +0100

#1570820 — [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]

FromDavid Howells <dhowells@redhat.com>
Date2017-01-31 16:20 +0100
Subject[PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]
Message-ID<t5InT-2gX-13@gated-at.bofh.it>
Print the secure boot status in the x86 setup_arch() but otherwise do
nothing more for now.  More functionality will be added later, but this at
least allows for testing.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/x86/kernel/setup.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 4cfba947d774..22e4b47a5c14 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1176,6 +1176,20 @@ void __init setup_arch(char **cmdline_p)
 	/* Allocate bigger log buffer */
 	setup_log_buf(1);
 
+	if (IS_ENABLED(CONFIG_EFI)) {
+		switch (boot_params.secure_boot) {
+		case efi_secureboot_mode_disabled:
+			pr_info("Secure boot disabled\n");
+			break;
+		case efi_secureboot_mode_enabled:
+			pr_info("Secure boot enabled\n");
+			break;
+		default:
+			pr_info("Secure boot could not be determined\n");
+			break;
+		}
+	}
+
 	reserve_initrd();
 
 	acpi_table_upgrade();

[toc] | [next] | [standalone]


#1573230

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2017-02-03 17:10 +0100
Message-ID<t6OAV-3WY-17@gated-at.bofh.it>
In reply to#1570820
On 31 January 2017 at 15:14, David Howells <dhowells@redhat.com> wrote:
> Print the secure boot status in the x86 setup_arch() but otherwise do
> nothing more for now.  More functionality will be added later, but this at
> least allows for testing.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> ---
>
>  arch/x86/kernel/setup.c |   14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index 4cfba947d774..22e4b47a5c14 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -1176,6 +1176,20 @@ void __init setup_arch(char **cmdline_p)
>         /* Allocate bigger log buffer */
>         setup_log_buf(1);
>
> +       if (IS_ENABLED(CONFIG_EFI)) {

Shouldn't this be a runtime check?

> +               switch (boot_params.secure_boot) {
> +               case efi_secureboot_mode_disabled:
> +                       pr_info("Secure boot disabled\n");
> +                       break;
> +               case efi_secureboot_mode_enabled:
> +                       pr_info("Secure boot enabled\n");
> +                       break;
> +               default:
> +                       pr_info("Secure boot could not be determined\n");
> +                       break;
> +               }
> +       }
> +
>         reserve_initrd();
>
>         acpi_table_upgrade();
>

[toc] | [prev] | [next] | [standalone]


#1573237 — Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]

FromDavid Howells <dhowells@redhat.com>
Date2017-02-03 17:30 +0100
SubjectRe: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]
Message-ID<t6OUh-442-3@gated-at.bofh.it>
In reply to#1573230
David Howells <dhowells@redhat.com> wrote:

> Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> 
> > Yes, but only if you are booting via UEFI, no?
> 
> Why limit it so?  Even if you don't boot via UEFI, the bootloader/kexec can
> always set the secure-boot state on.
> 
> > So perhaps use efi_enabled(EFI_BOOT) instead?
> 
> I've no objection to that, given it incorporates a test of CONFIG_EFI.

Feel free to just go ahead and change it in the patch.  We can always take the
check out later.

David

[toc] | [prev] | [next] | [standalone]


#1573244

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2017-02-03 17:30 +0100
Message-ID<t6OUi-442-29@gated-at.bofh.it>
In reply to#1573237
On 3 February 2017 at 16:29, David Howells <dhowells@redhat.com> wrote:
> David Howells <dhowells@redhat.com> wrote:
>
>> Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>>
>> > Yes, but only if you are booting via UEFI, no?
>>
>> Why limit it so?  Even if you don't boot via UEFI, the bootloader/kexec can
>> always set the secure-boot state on.
>>
>> > So perhaps use efi_enabled(EFI_BOOT) instead?
>>
>> I've no objection to that, given it incorporates a test of CONFIG_EFI.
>
> Feel free to just go ahead and change it in the patch.  We can always take the
> check out later.
>

Sure

[toc] | [prev] | [next] | [standalone]


#1573279

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2017-02-03 18:10 +0100
Message-ID<t6Px0-4x4-9@gated-at.bofh.it>
In reply to#1573244
On 3 February 2017 at 16:29, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> On 3 February 2017 at 16:29, David Howells <dhowells@redhat.com> wrote:
>> David Howells <dhowells@redhat.com> wrote:
>>
>>> Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>>>
>>> > Yes, but only if you are booting via UEFI, no?
>>>
>>> Why limit it so?  Even if you don't boot via UEFI, the bootloader/kexec can
>>> always set the secure-boot state on.
>>>
>>> > So perhaps use efi_enabled(EFI_BOOT) instead?
>>>
>>> I've no objection to that, given it incorporates a test of CONFIG_EFI.
>>
>> Feel free to just go ahead and change it in the patch.  We can always take the
>> check out later.
>>
>
> Sure

OK, I have queued these patches (minus the DeployedMode one) in the
next branch on efi.git. Please double check, I will send out a pull
request to tip shortly (once the autobuilder gives me the green light)

Thanks,
Ard.

[toc] | [prev] | [next] | [standalone]


#1573283 — Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]

FromDavid Howells <dhowells@redhat.com>
Date2017-02-03 18:20 +0100
SubjectRe: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]
Message-ID<t6PGF-4Az-11@gated-at.bofh.it>
In reply to#1573279
Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> OK, I have queued these patches (minus the DeployedMode one) in the
> next branch on efi.git. Please double check, I will send out a pull
> request to tip shortly (once the autobuilder gives me the green light)

Looks okay.  Now if I can just squeeze a fixed grub2 out of Peter Jones...

David

[toc] | [prev] | [next] | [standalone]


#1573238

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2017-02-03 17:30 +0100
Message-ID<t6OUh-442-7@gated-at.bofh.it>
In reply to#1573230
On 3 February 2017 at 16:21, David Howells <dhowells@redhat.com> wrote:
> Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>
>> > +       if (IS_ENABLED(CONFIG_EFI)) {
>>
>> Shouldn't this be a runtime check?
>
> Interesting question.  The original patch I was working from had a #ifdef
> here.  Possibly it doesn't need to be there at all.  We could rely entirely on
> the value of boot_params.secure_boot.
>

Yes, but only if you are booting via UEFI, no? So perhaps use
efi_enabled(EFI_BOOT) instead?

[toc] | [prev] | [next] | [standalone]


#1573246 — Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]

FromDavid Howells <dhowells@redhat.com>
Date2017-02-03 17:30 +0100
SubjectRe: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]
Message-ID<t6OUh-442-5@gated-at.bofh.it>
In reply to#1573238
Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> Yes, but only if you are booting via UEFI, no?

Why limit it so?  Even if you don't boot via UEFI, the bootloader/kexec can
always set the secure-boot state on.

> So perhaps use efi_enabled(EFI_BOOT) instead?

I've no objection to that, given it incorporates a test of CONFIG_EFI.

David

[toc] | [prev] | [next] | [standalone]


#1573243 — Re: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]

FromDavid Howells <dhowells@redhat.com>
Date2017-02-03 17:30 +0100
SubjectRe: [PATCH 7/7] efi: Print the secure boot status in x86 setup_arch() [ver #7]
Message-ID<t6OUh-442-9@gated-at.bofh.it>
In reply to#1573230
Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> > +       if (IS_ENABLED(CONFIG_EFI)) {
> 
> Shouldn't this be a runtime check?

Interesting question.  The original patch I was working from had a #ifdef
here.  Possibly it doesn't need to be there at all.  We could rely entirely on
the value of boot_params.secure_boot.

David

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web