Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp308218imm; Thu, 21 Jun 2018 19:11:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLF0SOKljy7vlUA3c8iwbfvEli3Zs8VkkNzhdVk0/Qj/wNMs59hbUVZlW0N3dT4A9YnIqiN X-Received: by 2002:a62:d388:: with SMTP id z8-v6mr30158010pfk.8.1529633469004; Thu, 21 Jun 2018 19:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529633468; cv=none; d=google.com; s=arc-20160816; b=MYs/Y6d6T5J3NO+aBNIm7FnwbLoI2Q9j85qbSZHgHFfX6FuE1ugiNJMKt0E3LKr6gn CEB3/TzBs5uiO//+IVu688HnB8zYEW23SfuR4iEidkHLX5WvcbUOxGbXHJVr/IElukTS lGaBCcavNEgZ/2ObAq/WalaVJUhxmHQrM1DJ0GKUGTZD+OaDYAoFs7VAYTmqKwNGFER2 5mtwJwltWjfzZAkgqna5TUgyFqRZP8pJd6ZyXciXYMlGrwBlKbkgbMWoDufgryneCE0P 8WoeVZ81O7Y+1+YG+O/sSRT9kJzNsge3NDkeW5krloSJpLJD1ex7qyAio/gVyOzT5LbP OwoQ== 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=N+e19ivInhuDHKsBv0tSe3Xu+Qt6Pmk2YjhlRPg7o1w=; b=urMOES5zz41YGBv1IW7nxjlYBBlXfar+/qRL3ekBwfgR/FiRYcDCQosnivslCpYm0F El3+IKUfGWHR05jvCy3cfrl8JylqkXXmSfO3/1GWcMG0jCHIv5t2ev8tASTzrP/WzKhX qxA1B+RS+e+biYvNb90WqF8lkDg50dDGZK8DhvQ3cbC0rOpJUP7NYvVOXWvQrNWVz3KO +b9ploMNBdqF3bsGHb+32GXUx8PFheWq4Zcdmf8RlxESQruWfFYvm0+lCJOvZBlaHsyI Fz9PsKCfErKlmJVvlJ/fT9BVpAWvku77Ki6rz/w4WQvK+cr+zmgR+UJQ8u8wQ2naRhDf AxrA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6-v6si6020833pln.486.2018.06.21.19.10.54; Thu, 21 Jun 2018 19:11:08 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934320AbeFVCIi (ORCPT + 99 others); Thu, 21 Jun 2018 22:08:38 -0400 Received: from mga14.intel.com ([192.55.52.115]:37897 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934181AbeFVCIh (ORCPT ); Thu, 21 Jun 2018 22:08:37 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2018 19:08:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,255,1526367600"; d="scan'208";a="51896125" Received: from sandybridge-desktop.sh.intel.com (HELO sandybridge-desktop) ([10.239.160.116]) by orsmga006.jf.intel.com with ESMTP; 21 Jun 2018 19:08:35 -0700 Date: Fri, 22 Jun 2018 10:14:10 +0800 From: Yu Chen To: Pavel Machek 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: <20180622021410.GA30305@sandybridge-desktop> References: <20180621085332.GA21807@amd> <20180621191443.GB14623@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180621191443.GB14623@amd> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 should > > >> be derived in kernel or in user space. And it turns out to be generating > > >> 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. > > > > Not having to transfer plain text kernel memory to user space is one > > IMO. > > Well, AFAICT in this case userland has the key and encrypted data are > on disk. That does not seem to be improvement. > 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. Best, Yu