linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evan Green <evgreen@chromium.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>, LKML <linux-kernel@vger.kernel.org>,
	Matthew Garrett <mgarrett@aurora.tech>,
	Daniil Lunev <dlunev@google.com>,
	zohar@linux.ibm.com, "James E.J. Bottomley" <jejb@linux.ibm.com>,
	linux-integrity@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Gwendal Grignou <gwendal@chromium.org>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	David Howells <dhowells@redhat.com>, Hao Wu <hao.wu@rubrik.com>,
	James Morris <jmorris@namei.org>, Jason Gunthorpe <jgg@ziepe.ca>,
	Len Brown <len.brown@intel.com>, Peter Huewe <peterhuewe@gmx.de>,
	"Serge E. Hallyn" <serge@hallyn.com>, axelj <axelj@axis.com>,
	keyrings@vger.kernel.org,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH 00/10] Encrypted Hibernation
Date: Mon, 1 Aug 2022 15:32:50 -0700	[thread overview]
Message-ID: <CAE=gft6sPkhNcz7+fJuDzQo2f8fM_0Wv_OWC9W2LyvXd6M6zeQ@mail.gmail.com> (raw)
In-Reply-To: <CAE=gft5OYAgosqmwNkk=Cwoooeg93Njmnzfz=gwCaLB0Ts+=sw@mail.gmail.com>

On Thu, Jun 16, 2022 at 8:42 AM Evan Green <evgreen@chromium.org> wrote:
>
> On Tue, May 17, 2022 at 10:34 AM Evan Green <evgreen@chromium.org> wrote:
> >
> > Hi Rafael,
> >
> > On Tue, May 17, 2022 at 9:06 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
> > >
> > > On Mon, May 9, 2022 at 6:44 PM Evan Green <evgreen@chromium.org> wrote:
> > > >
> > > > On Fri, May 6, 2022 at 9:08 AM Pavel Machek <pavel@ucw.cz> wrote:
> > > > >
> > > > > Hi!
> > > > >
> > > > > > We are exploring enabling hibernation in some new scenarios. However,
> > > > > > our security team has a few requirements, listed below:
> > > > > > 1. The hibernate image must be encrypted with protection derived from
> > > > > >    both the platform (eg TPM) and user authentication data (eg
> > > > > >    password).
> > > > > > 2. Hibernation must not be a vector by which a malicious userspace can
> > > > > >    escalate to the kernel.
> > > > >
> > > > > Can you (or your security team) explain why requirement 2. is needed?
> > > > >
> > > > > On normal systems, trusted userspace handles kernel upgrades (for example),
> > > > > so it can escalate to kernel priviledges.
> > > > >
> > > >
> > > > Our systems are a little more sealed up than a normal distro, we use
> > > > Verified Boot [1]. To summarize, RO firmware with an embedded public
> > > > key verifies that the kernel+commandline was signed by Google. The
> > > > commandline includes the root hash of the rootfs as well (where the
> > > > modules live). So when an update is applied (A/B style, including the
> > > > whole rootfs), assuming the RO firmware stayed RO (which requires
> > > > physical measures to defeat), we can guarantee that the kernel,
> > > > commandline, and rootfs have not been tampered with.
> > > >
> > > > Verified boot gives us confidence that on each boot, we're at least
> > > > starting from known code. This makes it more challenging for an
> > > > attacker to persist an exploit across reboot. With the kernel and
> > > > modules verified, we try to make it non-trivial for someone who does
> > > > manage to gain root execution once from escalating to kernel
> > > > execution. Hibernation would be one obvious escalation route, so we're
> > > > hoping to find a way to enable it without handing out that easy
> > > > primitive.
> > > >
> > > > [1] https://www.chromium.org/chromium-os/chromiumos-design-docs/verified-boot/
> > >
> > > So I guess this really is an RFC.
> >
> > Yes, I suppose it is.
> >
> > >
> > > Honestly, I need more time to go through this and there are pieces of
> > > it that need to be looked at other people (like the TPM-related
> > > changes).
> >
> > No problem, thanks for the reply to let me know. I expect some back
> > and forth in terms of what should be hidden behind abstractions and
> > where exactly things should live. But I wanted to get this out to
> > upstream as early as I could, just to get initial reactions on the
> > overall concept and design. Looking forward to hearing your thoughts
> > when you get a chance, and let me know if there are others I should be
> > adding that I've missed.
>
> Gentle bump in case this dropped off of radars, I'd still appreciate
> any feedback folks had on this series.

One more bump here, as we'd really love to get encrypted hibernation
to a form upstream would accept if at all possible. We were
considering landing this in our Chrome OS tree for now, then coming
back in a couple months with a "we've been baking this ourselves and
it's going so great, oooh yeah". I'm not sure if upstream would find
that compelling or not. But in any case, some guidance towards making
this more upstream friendly would be well appreciated.

One thing I realized in attempting to pick this myself is that the
trusted key blob format has moved to ASN.1. So I should really move
the creation ticket to the new ASN.1 format (if I can figure out the
right OID for that piece), which would allow me to drop a lot of the
ugly stuff in tpm2_unpack_blob(). Maybe if I get no other comments
I'll work on that and resend.

-Evan

  reply	other threads:[~2022-08-01 22:33 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 23:20 [PATCH 00/10] Encrypted Hibernation Evan Green
2022-05-04 23:20 ` [PATCH 01/10] tpm: Add support for in-kernel resetting of PCRs Evan Green
2022-05-04 23:20 ` [PATCH 02/10] tpm: Allow PCR 23 to be restricted to kernel-only use Evan Green
2022-05-04 23:20 ` [PATCH 03/10] security: keys: trusted: Parse out individual components of the key blob Evan Green
2022-05-04 23:20 ` [PATCH 04/10] security: keys: trusted: Allow storage of PCR values in creation data Evan Green
2022-08-02 23:00   ` Eric Biggers
2022-08-03 20:48     ` Evan Green
2022-05-04 23:20 ` [PATCH 05/10] security: keys: trusted: Verify " Evan Green
2022-05-04 23:20 ` [PATCH 06/10] PM: hibernate: Add kernel-based encryption Evan Green
2022-08-29 21:45   ` TPM: hibernate with IMA PCR 10 Ken Goldman
2022-08-29 21:51     ` Matthew Garrett
2022-08-31  2:48       ` Jarkko Sakkinen
2022-09-07 20:47         ` Evan Green
2022-09-07 23:57           ` Mimi Zohar
2022-09-08  5:25             ` Jarkko Sakkinen
2022-09-11  2:40               ` Mimi Zohar
2022-09-20  4:36                 ` Jarkko Sakkinen
2022-09-21 20:15                   ` Mimi Zohar
2022-09-23 13:30                     ` Jarkko Sakkinen
2022-09-27 16:03                       ` Evan Green
2022-09-28  9:42                         ` Jonathan McDowell
2022-05-04 23:20 ` [PATCH 07/10] PM: hibernate: Use TPM-backed keys to encrypt image Evan Green
2022-05-04 23:21 ` [PATCH 08/10] PM: hibernate: Mix user key in encrypted hibernate Evan Green
2022-05-06 16:08   ` Pavel Machek
2022-05-09 16:44     ` Evan Green
2022-05-10 12:29       ` Pavel Machek
2022-05-10 16:02         ` Evan Green
2022-08-02 22:48   ` Eric Biggers
2022-08-03 20:48     ` Evan Green
2022-05-04 23:21 ` [PATCH 09/10] PM: hibernate: Verify the digest encryption key Evan Green
2022-08-02 22:51   ` Eric Biggers
2022-05-04 23:21 ` [PATCH 10/10] PM: hibernate: seal the encryption key with a PCR policy Evan Green
2022-05-06 16:08 ` [PATCH 00/10] Encrypted Hibernation Pavel Machek
2022-05-09 16:43   ` Evan Green
2022-05-17 16:06     ` Rafael J. Wysocki
2022-05-17 17:34       ` Evan Green
2022-06-16 15:42         ` Evan Green
2022-08-01 22:32           ` Evan Green [this message]
2022-08-02 18:36             ` Matthew Garrett
2022-08-04  0:59               ` Jarkko Sakkinen
2022-08-04 21:55                 ` Evan Green
2022-08-06 18:21                   ` Jarkko Sakkinen

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='CAE=gft6sPkhNcz7+fJuDzQo2f8fM_0Wv_OWC9W2LyvXd6M6zeQ@mail.gmail.com' \
    --to=evgreen@chromium.org \
    --cc=axelj@axis.com \
    --cc=corbet@lwn.net \
    --cc=dhowells@redhat.com \
    --cc=dlunev@google.com \
    --cc=gwendal@chromium.org \
    --cc=hao.wu@rubrik.com \
    --cc=jarkko@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=jgg@ziepe.ca \
    --cc=jmorris@namei.org \
    --cc=keyrings@vger.kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mgarrett@aurora.tech \
    --cc=pavel@ucw.cz \
    --cc=peterhuewe@gmx.de \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=serge@hallyn.com \
    --cc=zohar@linux.ibm.com \
    /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).