Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1268596imu; Wed, 9 Jan 2019 14:58:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Xg2yw46EhO7TUuggGUFo0WxdhpH8kKz6fqo4thwZuXF0E/AcrQ6Oeh6Q1DJQSLxLwhdNd X-Received: by 2002:a17:902:b595:: with SMTP id a21mr7631180pls.120.1547074729822; Wed, 09 Jan 2019 14:58:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547074729; cv=none; d=google.com; s=arc-20160816; b=D4t6aUe1G7bRiKAJor/bo0rf2/c/PfcNxIC6mgDB4ji8qFdkzC6kvscbRelIveWEKB J/1WHH2KMKZQvx/s1GRxA4jNLRYqpY9v5FGh9QVjtLAX4DGwh6rE2vrtNbsFAJTYXfKZ 0bWO4duWnOe8GjmsjaIc/UaL19IZQTy5lowAmzUMH9hqmCVb58P923Oj3VAAnGPNYWDW LErjbyovMgbSjbW6PyLJMjjy0BRkNYATjNK4BOd0W+E7SyiTLdkQRuiRbNIUjNeeqssJ ZRowaAye9sOcjZMu3t7WN4uzYux/4343ir5JPHc7uqre+27hE8bUZOQc9ER4nvSOdedE b6cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yw9SgPCSjKww056Pxb0MS+Zw8gRlyBi7gKqvz3bqe4M=; b=YT/1ZUgivCnvA++PZGXo43xymbmJPvF/xjqyIF6U4kSP+GFA0b75UyC7l/A88C3KzZ UC1W+Qi39Hlm866BGG7C6AqjOACm3ckoAEzcB4eOh+oJvm3/QUdjDJkqoODPS68V4qng Ugt8iP7A5n0xbaudswLDXvVIgzwuI3pl81Z0NrXtbgDveZGrLWw1JSDSAeWMzcRUwhNK 3cBiqEMU9Z1Kg0jUotSD9gKJS4hMjbYjnivca75jtjEtxMTxzX0b0oPuC9opd935tGFI IRbsy+5dGe8XY3oOZbGrxdpBuTWcpRZNjsAdEmEUiYWzRJxSFWXBGGc53kZlgKW3B7o6 uYwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h19si21205801pgg.274.2019.01.09.14.58.34; Wed, 09 Jan 2019 14:58:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727060AbfAIWTc (ORCPT + 99 others); Wed, 9 Jan 2019 17:19:32 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:45739 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbfAIWTb (ORCPT ); Wed, 9 Jan 2019 17:19:31 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 909B2808A8; Wed, 9 Jan 2019 23:19:23 +0100 (CET) Date: Wed, 9 Jan 2019 23:19:28 +0100 From: Pavel Machek To: James Bottomley Cc: Andy Lutomirski , Jarkko Sakkinen , Stephan Mueller , Herbert Xu , "Lee, Chun-Yi" , "Rafael J . Wysocki" , LKML , linux-pm@vger.kernel.org, keyrings@vger.kernel.org, "Rafael J. Wysocki" , Chen Yu , Oliver Neukum , Ryan Chen , David Howells , Giovanni Gherdovich , Randy Dunlap , Jann Horn Subject: Re: [PATCH 1/5 v2] PM / hibernate: Create snapshot keys handler Message-ID: <20190109221928.GA32688@amd> References: <20190108050358.llsox32hggn2jioe@gondor.apana.org.au> <1565399.7ulKdI1fm5@tauon.chronox.de> <1546994671.6077.10.camel@HansenPartnership.com> <1547016579.2789.17.camel@HansenPartnership.com> <1547063189.2879.47.camel@HansenPartnership.com> <1547070220.2758.4.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <1547070220.2758.4.camel@HansenPartnership.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > Note if someone has your laptop and the ability to boot their own > > > kernels, they could always corrupt the kernel into decrypting the > > > image or giving you the unsealed key, but there's no real way of > > > preventing that even with PCR sealing or lockdown, so the basis for > > > the threat model is very much my laptop in my possession running my > > > kernel. > >=20 > > I'm not entirely sure I agree. With a TPM-aware bootloader, it > > really ought to be possible to seal to PCRs such that a corrupted > > kernel can't restore the image. Obviously a *compromised* but > > otherwise valid kernel will be able to restore the image. >=20 > It is possible to seal the key so that only the same booted kernel can > restore the image, yes. One of the measurements that goes into the > boot log is the hash of the kernel and you can seal to this value ... > obviously if you upgrade your kernel RPM (or shim or grub) this value > changes and you'd lose the ability to restore the hibernated image, but > since the image is very kernel specific, that's probably OK. Non-ancient kernels actually support hibernation by one kernel and restore by another one. But yes, normally it is same kernel binary doing hibernation and restore. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlw2c3AACgkQMOfwapXb+vJsLQCfQpFcrOhA1gXr6iyY8t2KD3C7 e9wAnR2l05dQ/Z/mafMvvKDMZM5JLHog =KQIG -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs--