Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3798005imm; Mon, 25 Jun 2018 04:55:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIZpuyz+rmfQafqAXtZcXiNsrJQJm06tUA+2LOzdk8N+w7cuXlL5KjrjDVfR1R+4CGi+fWf X-Received: by 2002:a62:33c4:: with SMTP id z187-v6mr1085560pfz.190.1529927757550; Mon, 25 Jun 2018 04:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529927757; cv=none; d=google.com; s=arc-20160816; b=YpGISUrIILsXxZ9ye+6lkCbbKxVuaexUaJZ/hjPzEfagaPw+9y6Rz07FErNkK8KXYe +LxMPgzuytmfzIp9KVWbqxtA9KyVlIUfd8lhc/poe9C7rW0ooQymTXnYlg4O4kw9DZ7J Xm6b/gFpqiDUNkv0U3suXbQ1If0DCJEKqoB7OCdZwh1/77KAewFEBxFbienHOboxfvT9 oLY0G6SGhBwyIqiSKi3PrxxnYjNzuTnG3JMIVihNPjtsoxUICgejOOJLccS+967rW5G6 vM2Xfs0Q4S7o6eYtlQcW8JornA+fhrtRSOQTwsQ4prJS3K3D7EGdqkPwwUFlDQdqohCR 0t2Q== 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:arc-authentication-results; bh=yAbqMnvOGeSzWwMaajkbKbysGmCWuk7BL2bVQo/F3NU=; b=GbR51IJDwxbuOKwXG5YkoYaXOJ/q+q5WFYz5tUYPghhMS2MD6pQocIeGgjtnPK9fAV g2z8KXuWrSq611f4p3L2lkyYrvgBphk7gZ0ikyAGq6WNTRPoKsytgyaOlKILWlIgqhRg Ig14HKQVkw4uLiW1mYo/7Y5qAtLVorSda3+DJvLXCV4/0ReCJqXcsQkMqty1Zk/yWW2k w0FpDD91UaW7Z1zyR/b/dvlgfZsgNsJEDyKt3821qL35bbThlnEDzPYgJq+/5byFZwxo jK/o2wnONYJ1OkUzlhCirRn0ItseCT2bxKKxal+CGpOetQjHBpIlrlbVNvHScG6aFEdL Knjg== 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 g92-v6si14032008plg.0.2018.06.25.04.55.43; Mon, 25 Jun 2018 04:55:57 -0700 (PDT) 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 S932888AbeFYLzD (ORCPT + 99 others); Mon, 25 Jun 2018 07:55:03 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:38925 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932294AbeFYLzC (ORCPT ); Mon, 25 Jun 2018 07:55:02 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 24A5D804F2; Mon, 25 Jun 2018 13:55:01 +0200 (CEST) Date: Mon, 25 Jun 2018 13:55:00 +0200 From: Pavel Machek To: Yu Chen Cc: "Rafael J. Wysocki" , Len Brown , "Lee, Chun-Yi" , Borislav Petkov , Linux PM , Linux Kernel Mailing List Subject: Re: [PATCH 0/3][RFC] Introduce the in-kernel hibernation encryption Message-ID: <20180625115500.GC17001@amd> References: <20180621085332.GA21807@amd> <20180621191443.GB14623@amd> <20180622021410.GA30305@sandybridge-desktop> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KN5l+BnMqAQyZLvT" Content-Disposition: inline In-Reply-To: <20180622021410.GA30305@sandybridge-desktop> 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 --KN5l+BnMqAQyZLvT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri 2018-06-22 10:14:10, Yu Chen wrote: > Hi, > On Thu, Jun 21, 2018 at 09:14:43PM +0200, Pavel Machek wrote: > > On Thu 2018-06-21 14:08:40, Rafael J. Wysocki wrote: > > > On Thu, Jun 21, 2018 at 10:53 AM, Pavel Machek wrote: > > > > Hi! > > > > > > > >> As security becomes more and more important, we add the in-kernel > > > >> encryption support for hibernation. > > > > ... > > > >> There was a discussion on the mailing list on whether this key sho= uld > > > >> be derived in kernel or in user space. And it turns out to be gene= rating > > > >> the key by user space is more acceptable[1]. So this patch set is = divided > > > >> into two parts: > > > >> 1. The hibernation snapshot encryption in kernel space, > > > >> 2. the key derivation implementation in user space. > > > > > > > > uswsusp was created so that this kind of stuff could be kept in > > > > userspace. You get graphical progress bar (etc) too. As you already > > > > have userspace component for key derivation, I see no advantages to > > > > uswsusp. > > > > > > > > If you have some, please explain. > > >=20 > > > Not having to transfer plain text kernel memory to user space is one > > > IMO. > >=20 > > Well, AFAICT in this case userland has the key and encrypted data are > > on disk. That does not seem to be improvement. > >=20 > uswsusp needs to read the snapshot from kernel first, while > do encryption in kernel directly would reduce the IO. Besides, > the kernel memory content is protect from been read from > user space from first place, although finally they are > encrypted on the disk. If you believe you solution is faster, please benchmark it. I don't believe it will be. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --KN5l+BnMqAQyZLvT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlsw2BQACgkQMOfwapXb+vIZdQCbByX/k7dabVOX6HzJFQTjbxFF IDwAnRVsqQDh29IQ2YA4+Yq4cmIimj01 =6hGn -----END PGP SIGNATURE----- --KN5l+BnMqAQyZLvT--