All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Ard Biesheuvel <ardb@kernel.org>,
	Emanuele Giuseppe Esposito <eesposit@redhat.com>
Cc: x86@kernel.org, "Thomas Gleixner" <tglx@linutronix.de>,
	bluca@debian.org, lennart@poettering.net,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Alexander Potapenko" <glider@google.com>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Vitaly Kuznetsov" <vkuznets@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2] x86/boot: add .sbat section to the bzImage
Date: Tue, 18 Jul 2023 15:34:52 +0200	[thread overview]
Message-ID: <df7941b9-11ea-9abd-e070-4e9926aecdc3@redhat.com> (raw)
In-Reply-To: <ZK/9MlTh435FP5Ji@gambale.home>

[note: while there is some overlap between the developers and Red Hat 
employees that are involved in KVM, I was not involved in this work and 
only learnt about it last Friday]

On 7/13/23 15:33, Ard Biesheuvel wrote:
>> A .sbat is simply a section containing a string with the component name
>> and a version number. This version number is compared with the value in
>> OVMF_VARS, and if it's less than the variable, the binary is not trusted,
>> even if it is correctly signed.
>>
> 
> Also, 'version number' is a bit vague, better to stick with existing
> terminology that makes this more self explanatory: the component that
> authenticates the kernel image keeps a revocation counter, and refuses
> to load authentic images whose revocation index is lower than the
> revocation counter. This approach removes the need for revoking
> individual image hashes or having to rotate the signing keys when a
> vulnerability is discovered.
> 
> The argument that we need this in the upstream kernel seems to be
> predicated on the assumption that there is one universal signing
> authority and revocation domain, but this is not necessarily true.

I am not sure about this.  I think that a revocation index could _in 
theory_ make sense as a way to double check that you have backported all 
the relevant bugfixes.  If you backport the patch that changes the index 
from 2 to 3 but your tree has index=1, it will conflict and hopefully 
fix it or lead you to document why that is happening.

But I'm saying "in theory", because I'm not sure it makes sense to apply 
the concept to an OS kernel.  A revocation index makes sense for boot 
loaders, whose purpose is to check something about the next stage and 
then get out of the way.  When using a bootloader for secure boot there 
is a limited amount of parsing and basically no user interaction.  With 
some handwaving, that makes it is possible to say things like "oh no I 
found the 234th bug in my codebase, let's bump the revocation index to 235".

If you try to do this for the OS, however, Linux's "vulnerabilities are 
just bugs" mantra hits hard---more specifically the reverse: all bugs 
are potential vulnerabilities.  Sure you can hope for the best, which is 
what we do with module signing and with the (non-upstream) secure boot 
lockdown patches.  In the end, however, an unpatched code execution or 
memory write vulnerability is always a potential rootkit.  While we 
don't have _too_ many of those, there are enough that the idea of a 
revocation index becomes completely unfeasible, not too mention those 
that are fixed silently not because "that's the way Linus does it" but 
rather because we genuinely didn't think of them as security fixes.

So perhaps there could be some kind of protocol that would let a new 
kernel tell the bootloader "don't boot an older kernel than me in the 
future".  It could even be an extension to the SBAT spec itself.  I 
haven't really thought much about it, tbh.  However, I'm quite positive 
that a revocation index attached to the kernel image cannot really work 
as a concept, not even if it is managed by the distro.

Paolo


  parent reply	other threads:[~2023-07-18 13:35 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 15:44 [RFC PATCH v2] x86/boot: add .sbat section to the bzImage Emanuele Giuseppe Esposito
2023-07-12  1:21 ` H. Peter Anvin
2023-07-12  1:33 ` H. Peter Anvin
2023-07-12  6:19   ` Emanuele Giuseppe Esposito
2023-07-12 12:00     ` Borislav Petkov
2023-07-12 12:48       ` Daniel P. Berrangé
2023-07-12 13:28         ` Borislav Petkov
2023-07-12 14:06           ` Daniel P. Berrangé
2023-07-12 15:43             ` Greg KH
2023-07-12 16:23               ` Luca Boccassi
2023-07-12 16:57                 ` Greg KH
2023-07-12 18:59                   ` Luca Boccassi
2023-07-12 19:05                     ` Greg KH
2023-07-12 19:35                       ` Luca Boccassi
2023-07-12 19:42                         ` Borislav Petkov
2023-07-12 19:56                           ` Luca Boccassi
2023-07-12 20:01                             ` Borislav Petkov
2023-07-12 20:16                               ` Luca Boccassi
2023-07-12 20:07                         ` Greg KH
2023-07-12 20:41                           ` Luca Boccassi
2023-07-12 21:11                             ` Greg KH
2023-07-12 21:12                             ` Willy Tarreau
2023-07-12 22:32                               ` Luca Boccassi
2023-07-12 21:20                             ` Greg KH
2023-07-12 21:50                               ` Luca Boccassi
2023-07-13  6:09                                 ` Greg KH
2023-07-14  0:29                                   ` Luca Boccassi
2023-07-15  6:51                                     ` Greg KH
2023-07-16 17:41                                       ` Luca Boccassi
2023-07-16 18:28                                         ` Greg KH
2023-07-17  9:22                                           ` Daniel P. Berrangé
2023-07-17 11:06                                             ` Peter Zijlstra
2023-07-17 11:47                                               ` Daniel P. Berrangé
2023-07-17 14:10                                                 ` Greg KH
2023-07-17 11:12                                             ` Luca Boccassi
2023-07-17 14:11                                               ` Greg KH
2023-07-17 14:06                                             ` Greg KH
2023-07-12 15:45 ` Greg KH
2023-07-13  8:57   ` Vitaly Kuznetsov
2023-07-13  9:16     ` Peter Zijlstra
2023-07-13 14:58     ` Greg KH
2023-07-13 15:51       ` Vitaly Kuznetsov
2023-07-13 16:58         ` Greg KH
2023-07-13 20:49           ` Emanuele Giuseppe Esposito
2023-07-13 22:04             ` Greg KH
2023-07-14  6:57               ` Emanuele Giuseppe Esposito
2023-07-15  6:59                 ` Greg KH
2023-07-13 13:33 ` Ard Biesheuvel
2023-07-13 13:52   ` Ard Biesheuvel
2023-07-13 20:39     ` Emanuele Giuseppe Esposito
2023-07-13 22:31     ` Luca Boccassi
2023-07-14  8:52       ` Ard Biesheuvel
2023-07-14  9:13         ` Matthew Garrett
2023-07-14  9:14           ` Ard Biesheuvel
2023-07-14  9:25         ` Luca Boccassi
2023-07-17 16:08     ` James Bottomley
2023-07-17 16:56       ` Daniel P. Berrangé
2023-07-17 17:15         ` James Bottomley
2023-07-17 18:16           ` Daniel P. Berrangé
2023-07-20 16:46           ` Eric Snowberg
2023-07-20 17:07             ` James Bottomley
2023-07-20 18:10               ` Eric Snowberg
2023-07-20 19:16             ` Luca Boccassi
2023-07-21  0:02               ` Eric Snowberg
2023-07-21  8:55                 ` Luca Boccassi
2023-07-21 11:24                   ` James Bottomley
2023-07-21 12:40                     ` Luca Boccassi
2023-07-21 13:01                       ` James Bottomley
2023-07-21 13:10                         ` Luca Boccassi
2023-07-21 13:33                           ` James Bottomley
2023-07-21 15:14                             ` Luca Boccassi
2023-07-21 15:22                               ` Luca Boccassi
2023-07-21 15:27                                 ` James Bottomley
2023-07-13 23:13   ` Luca Boccassi
2023-07-14  9:33     ` Ard Biesheuvel
2023-07-14  9:59       ` Daniel P. Berrangé
2023-07-14 10:40       ` Luca Boccassi
2023-07-18 13:34   ` Paolo Bonzini [this message]
2023-07-18 14:02     ` Luca Boccassi
2023-07-18 15:51       ` Paolo Bonzini
2023-07-18 16:35         ` Daniel P. Berrangé
2023-07-19 13:21           ` Paolo Bonzini
2023-07-19 13:34             ` Luca Boccassi
2023-07-19 15:11               ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df7941b9-11ea-9abd-e070-4e9926aecdc3@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=berrange@redhat.com \
    --cc=bluca@debian.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=eesposit@redhat.com \
    --cc=glider@google.com \
    --cc=hpa@zytor.com \
    --cc=lennart@poettering.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mingo@redhat.com \
    --cc=ndesaulniers@google.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.