linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg59@google.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: luto@kernel.org, David Howells <dhowells@redhat.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	jmorris@namei.org, Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	jforbes@redhat.com, linux-man@vger.kernel.org, jlee@suse.com,
	LSM List <linux-security-module@vger.kernel.org>,
	linux-api@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	linux-efi <linux-efi@vger.kernel.org>
Subject: Re: [GIT PULL] Kernel lockdown for secure boot
Date: Wed, 04 Apr 2018 04:30:18 +0000	[thread overview]
Message-ID: <CACdnJutuBaE3RaDx0KM5vDF9Sinrp=3tG9csrS-H3eU-J7-Utw@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFxgrh5eeG9MRSEsJtyL5yTe0TehZ=BS2josGJaLxoMMBQ@mail.gmail.com>

On Tue, Apr 3, 2018 at 6:43 PM Linus Torvalds
<torvalds@linux-foundation.org>
wrote:

> On Tue, Apr 3, 2018 at 6:13 PM, Matthew Garrett <mjg59@google.com> wrote:
> >
> > There are four cases:

> No.

> Matthew., stop with the agenda already.

> This shit is what I'm talking about:

> > Verified Boot off, lockdown on: Perception of security improvement
that's
> > trivially circumvented (and so bad)

> You're doing some serious value judgement that is simply bogus.

> If lockdown actually helps avoid CPL0 execution attacks, then it helps
> even if secure more is off.

Bear in mind that I'm talking about defaults here - in more constrained
configurations the answers may change. But the kernel has no way of knowing
whether it's in one of those configurations, and as a result there's an
argument for not overpromising on the security that you're providing users.
If a user has a configuration where you're able to verify that userspace
has some degree of protection (eg, disk encryption keys are in the TPM and
won't unseal if someone's switched out the kernel) then it's reasonable for
userland (or a kernel command line option) to enable the functionality.

What I'm afraid of is this turning into a "security" feature that ends up
being circumvented in most scenarios where it's currently deployed - eg,
module signatures are mostly worthless in the non-lockdown case because you
can just grab the sig_enforce symbol address and then kexec a preamble that
flips it back to N regardless of the kernel config. This is the sort of
thing that's not obvious to most users, and it potentially causes them to
make worse security decisions as a result. The goal for this part of the
patchset isn't to cover every single conceivable case, it's to provide
reasonable defaults in a way that makes life easier for distributions.

> Or think of virtual machines - which people often use on purpose for
> security things. Again, they very much are _not_ going to have secure
> boot, but it's not necessarily even possible to "replace the kernel
> and reboot" at all, because the kernel came from outside the virtual
> machine entirely, and rebooting might just kill the VM rather than
> restart anything.

And where you have a trustworthy external thing providing your kernel,
yeah, that's also an argument - and having a kernel command line argument
that enables it in this case also seems entirely reasonable.

> This is what I mean by having an agenda.  We all know you are a big
> proponent of secure boot. But it seems to cloud your arguments, by
> turning your assumptions and your agenda into an "argument" that is
> simply not even TRUE.

I'm making this argument from the perspective of "What should the kernel do
when it has no additional information". Having the kernel automatically
enable lockdown without the user being aware of which guarantees their
environment is providing risks giving users the impression of security that
they may not have - in that case it makes more sense to have the user make
an explicit decision to enable it.

> See what I'm unhappy about?

> > Verified Boot on, lockdown off: Perception of security improvement
that's
> > trivially circumvented (and so bad), status quo in mainline kernels

> I think this is entirely false too. Again, the "trivial circumvention"
> shows a bias and agenda that isn't really all that true.

> > Of these four options, only two make sense.

> No.

> You say that, because you have that bias and that agenda.

Ok. Only two make sense *in the absence of additional information about
local configuration*. Distributions have to make reasonable choices here,
and where a configuration choice decreases functionality and provides what
may only be a marginal increase in security it's not a good configuration
choice to make by default.

> That said, wouldn't it be equally good to just make the whole thing be
> a protected EFI variable instead? Once you have physical access to the
> EFI shell (to turn off secure boot) you have access to that too.

That's pretty much exactly what mokutil does, without you needing to find a
copy of the UEFI shell to install first. If you think there's a strong
enough need for it, we could definitely add an additional variable that
allowed you to disable lockdown without disabling signature validation.

  reply	other threads:[~2018-04-04  4:30 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30 23:29 [GIT PULL] Kernel lockdown for secure boot David Howells
2018-03-31  0:46 ` James Morris
2018-04-03  0:37   ` Andy Lutomirski
2018-04-03  0:59     ` Kees Cook
2018-04-03  1:47       ` Andy Lutomirski
2018-04-03  7:06   ` David Howells
2018-04-03 15:11     ` Andy Lutomirski
2018-04-03 15:41       ` Alexei Starovoitov
2018-04-03 16:26         ` Andy Lutomirski
2018-04-03 16:29       ` Matthew Garrett
2018-04-03 16:45         ` Andy Lutomirski
2018-04-03 18:45           ` Kees Cook
2018-04-03 19:01             ` Andy Lutomirski
2018-04-03 19:07               ` Kees Cook
2018-04-03 19:29           ` Matthew Garrett
2018-04-03 21:51             ` Andy Lutomirski
2018-04-04 18:42               ` Peter Jones
2018-04-04 20:01                 ` Thomas Gleixner
2018-04-04 20:18                   ` Matthew Garrett
2018-04-05 18:47                 ` Andy Lutomirski
2018-04-06  4:42                 ` Peter Dolding
2018-04-03 17:16         ` David Howells
2018-04-03 19:01           ` Andy Lutomirski
2018-04-03 19:49           ` David Howells
2018-04-03 21:58             ` Andy Lutomirski
2018-04-03 22:32             ` David Howells
2018-04-03 22:39               ` Andy Lutomirski
2018-04-03 22:46                 ` Linus Torvalds
2018-04-03 22:51                   ` Matthew Garrett
2018-04-03 22:53                     ` Andy Lutomirski
2018-04-03 23:08                       ` Justin Forbes
2018-04-03 23:09                       ` Matthew Garrett
2018-04-03 23:08                     ` Linus Torvalds
2018-04-03 23:10                       ` Linus Torvalds
2018-04-03 23:17                       ` Matthew Garrett
2018-04-03 23:26                         ` Linus Torvalds
2018-04-03 23:39                           ` Linus Torvalds
2018-04-03 23:47                             ` Matthew Garrett
2018-04-04  0:02                               ` Linus Torvalds
2018-04-04  0:04                                 ` Matthew Garrett
2018-04-04  0:08                                   ` Linus Torvalds
2018-04-04  0:12                                     ` Matthew Garrett
2018-04-05 14:58                                       ` Alan Cox
2018-04-04  0:22                                   ` David Howells
2018-04-05 17:59                                   ` Alan Cox
2018-04-05 18:03                                     ` Matthew Garrett
2018-04-03 23:45                           ` Matthew Garrett
2018-04-03 23:55                             ` Linus Torvalds
2018-04-03 23:59                               ` Matthew Garrett
2018-04-04  0:06                                 ` Linus Torvalds
2018-04-04  0:10                                   ` Matthew Garrett
2018-04-04  0:15                                     ` Linus Torvalds
2018-04-04  0:16                                       ` Matthew Garrett
2018-04-04  0:18                                         ` Andy Lutomirski
2018-04-04  0:19                                           ` Matthew Garrett
2018-04-04  9:04                                             ` Greg Kroah-Hartman
2018-04-04  0:25                                         ` Linus Torvalds
2018-04-04  0:33                                           ` Linus Torvalds
2018-04-04  0:46                                             ` Matthew Garrett
2018-04-04  0:56                                               ` Linus Torvalds
2018-04-04  1:13                                                 ` Matthew Garrett
2018-04-04  1:43                                                   ` Linus Torvalds
2018-04-04  4:30                                                     ` Matthew Garrett [this message]
2018-04-04 12:57                                                       ` Theodore Y. Ts'o
2018-04-04 13:02                                                         ` Greg Kroah-Hartman
2018-04-04 13:34                                                           ` Theodore Y. Ts'o
2018-04-04 13:57                                                             ` Greg Kroah-Hartman
2018-04-04 13:29                                                         ` Mike Galbraith
2018-04-04 16:20                                                         ` Matthew Garrett
2018-04-08 22:00                                                         ` Pavel Machek
2018-04-04 13:33                                                       ` David Howells
2018-04-04 13:52                                                         ` Theodore Y. Ts'o
2018-04-04 16:22                                                           ` Matthew Garrett
2018-04-04 16:39                                                             ` Andy Lutomirski
2018-04-04 16:42                                                               ` Matthew Garrett
2018-04-04 16:46                                                               ` Justin Forbes
2018-04-05  0:05                                                             ` Peter Dolding
2018-04-05  0:20                                                               ` Matthew Garrett
2018-04-04 13:57                                                         ` David Howells
2018-04-04 16:09                                                       ` Linus Torvalds
2018-04-04 16:17                                                         ` Matthew Garrett
2018-04-04  6:56                                                   ` Peter Dolding
2018-04-04 16:26                                                     ` Matthew Garrett
2018-04-05  1:28                                                       ` Peter Dolding
2018-04-04  1:30                                                 ` Justin Forbes
2018-04-04  1:58                                                   ` Linus Torvalds
2018-04-04  1:36                                                 ` Justin Forbes
2018-04-04  0:17                                   ` Jann Horn
2018-04-04  0:23                                     ` Andy Lutomirski
2018-04-04  8:05                                     ` David Howells
2018-04-04 14:35                                       ` Andy Lutomirski
2018-04-04 14:44                                       ` David Howells
2018-04-04 15:43                                       ` Eric W. Biederman
2018-04-03 23:56                         ` David Howells
2018-04-03 23:58                           ` Linus Torvalds
2018-04-03 23:39                 ` David Howells
2018-04-03 23:48                   ` Andy Lutomirski
2018-04-08  8:23                   ` Pavel Machek
2018-04-03 23:12               ` David Howells
2018-04-03 23:27                 ` Linus Torvalds
2018-04-03 23:42                 ` Andy Lutomirski
2018-04-03 20:53         ` Linus Torvalds
2018-04-03 20:54           ` Matthew Garrett
2018-04-03 21:01             ` Linus Torvalds
2018-04-03 21:08               ` Matthew Garrett
2018-04-03 21:21                 ` Al Viro
2018-04-03 21:37                   ` Matthew Garrett
2018-04-03 21:26                 ` Linus Torvalds
2018-04-03 21:32                   ` Matthew Garrett
2018-04-08  8:10                 ` Pavel Machek
2018-03-31 10:20 ` David Howells
2018-04-03 13:25   ` Ard Biesheuvel
2018-04-03 21:48     ` James Morris
2018-04-05 17:53     ` Alan Cox
2018-11-21 12:05 ` [PATCH next-lockdown 0/1] debugfs EPERM fix for 'Kernel lockdown for secure boot' patch series Vasily Gorbik
2018-11-21 12:05   ` [PATCH next-lockdown 1/1] debugfs: avoid EPERM when no open file operation defined Vasily Gorbik
  -- strict thread matches above, loose matches on Subject: below --
2018-04-04  2:34 [GIT PULL] Kernel lockdown for secure boot Alexei Starovoitov
2018-04-04  4:31 ` Matthew Garrett
2018-04-08  7:44   ` joeyli
2018-04-08  8:07 ` joeyli
2018-04-09  3:40   ` Alexei Starovoitov
2018-04-09  8:14     ` Daniel Borkmann
2018-04-09 13:55     ` joeyli
2017-10-26 16:37 David Howells
2017-10-26 18:22 ` Mimi Zohar
2017-10-26 19:20 ` James Morris

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='CACdnJutuBaE3RaDx0KM5vDF9Sinrp=3tG9csrS-H3eU-J7-Utw@mail.gmail.com' \
    --to=mjg59@google.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dhowells@redhat.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jforbes@redhat.com \
    --cc=jlee@suse.com \
    --cc=jmorris@namei.org \
    --cc=keescook@chromium.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).