Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3361968imm; Mon, 6 Aug 2018 03:29:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf6RcrKjFOfjh7iGmiOQmP3rKeBo7P0p7DZIb8SLrM5d3OtS/H4rTevIvHdclpVIE4REnnW X-Received: by 2002:a17:902:8f8c:: with SMTP id z12-v6mr13205553plo.4.1533551360686; Mon, 06 Aug 2018 03:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533551360; cv=none; d=google.com; s=arc-20160816; b=ENvlLrgmF+5IssjAo1RYo0+MvM/3xqFqK9hWm8L0/vUBW6Rl3DxQnDr7yGeZrPvL8Q X3mRyAL1hCBwZ1+av9bK8UBa+X5LSOiG0tg5g6iXPQAS+L6hC/XufbPWNGymHz3kxG3A sLNFJR3uwe0pf9fTjeqOq8dL8ocRw3voLTuYBnqny7uiqmUZiO8mIh0fKy27zJksx3gO tdDxytADCQm6Q77dixv3btTIzXM4j1pKh9/+IR0AIiGOSYxnUVMGbwBBmYrNI5u7lutD 2q0DMuLLnQ2Bz4zrvkajKqWPEtULsTh9J6gmqJpn+4rSLPqblVtOHPD3mwkV0Hvd5pdj 2LcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=holQ3fLfY840m7pk7Qh/lB2Cy7f35kui2uPaNn6qifI=; b=hJJZVln/F9X4bd7eqf3LsukDM0B/uG+/I2lQK/dozJqJ6pB6V1Hf3RPWjs0WZm8vvw ukYrqOC4Owm2w/HUIPEL6ocAcWmdkrUp7J15d/m+hkDfr5ufENFSOa1wJbOjT1PNcWYz SMyFECvLwg2Jo6dIEg6eZB3Fwuq/dw/nHVgvVgCzohUJAwx9aqKZHOWk5Oidm20ridLG naCPHjywsl1ZFC9HcQTcC6UpaMtP/iRshfdD1c2cooGEyX4mE19jnF9NpBD5ixsqFAN7 1QxDpxoATuxJ5PVZEKZm7VNrRmV4lxTr9ZtKJd2pHAxG7qvKfR/MESregHg6Wp5LLR92 V0vA== 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 3-v6si12908558pgr.554.2018.08.06.03.29.05; Mon, 06 Aug 2018 03:29:20 -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 S1729686AbeHFMgh (ORCPT + 99 others); Mon, 6 Aug 2018 08:36:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:40422 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727517AbeHFMgh (ORCPT ); Mon, 6 Aug 2018 08:36:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B0978AE1F; Mon, 6 Aug 2018 10:28:11 +0000 (UTC) Message-ID: <1533550820.15815.14.camel@suse.com> Subject: Re: [PATCH 0/4][RFC v2] Introduce the in-kernel hibernation encryption From: Oliver Neukum To: Yu Chen Cc: Pavel Machek , "Rafael J . Wysocki" , Eric Biggers , "Lee, Chun-Yi" , Theodore Ts o , Stephan Mueller , Denis Kenzior , linux-pm@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, "Gu, Kookoo" , "Zhang, Rui" Date: Mon, 06 Aug 2018 12:20:20 +0200 In-Reply-To: <20180806075754.GA12124@chenyu-desktop> References: <20180718202235.GA4132@amd> <20180718235851.GA22170@sandybridge-desktop> <20180719110149.GA4679@amd> <20180719132003.GA30981@sandybridge-desktop> <20180720102532.GA20284@amd> <1532346156.3057.11.camel@suse.com> <20180723162302.GA4503@sandybridge-desktop> <1532590246.7411.3.camel@suse.com> <20180806075754.GA12124@chenyu-desktop> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mo, 2018-08-06 at 15:57 +0800, Yu Chen wrote: > Hi Oliver, > On Thu, Jul 26, 2018 at 09:30:46AM +0200, Oliver Neukum wrote: > > On Di, 2018-07-24 at 00:23 +0800, Yu Chen wrote: > > > > > > Good point, we once tried to generate key in kernel, but people > > > suggest to generate key in userspace and provide it to the > > > kernel, which is what ecryptfs do currently, so it seems this > > > should also be safe for encryption in kernel. > > > https://www.spinics.net/lists/linux-crypto/msg33145.html > > > Thus Chun-Yi's signature can use EFI key and both the key from > > > user space. > > > > Hi, > > > > ecryptfs can trust user space. It is supposed to keep data > > safe while the system is inoperative. > > Humm, I did not quite get the point here, let's take fscrypt While the system is running and the fs is mounted, your data is as secure as root access to your machine, right? You encrypt a disk primarily so data cannot be recovered (and altered) while the system is not running. Secure Boot does not trust root fully. There is a cryptographic chain of trust and user space is not part of it. > for example, the kernel gets user generated key from user space, > and uses per-inode nonce(random bytes) as the master key to > do a KDF(key derivation function) on user provided key, and uses > that key for encryption. We can also added similar mechanism > to generate the key in kernel space but the key should be > original from user's provided key(password derived), because > the security boot/signature mechanism could not cover the case > that, two different users could resume to each other's context > because there isn't any certification during resume if it is > on the same physical hardware. Please explain. You will always have to suspend the whole machine with all tasks of all users. And STD with Secure Boot need not imply that you encrypt your discs. You need to encrypt only kernel memory to meet the requirements. As STD affects the whole machine it must require root rights. So I cannot see how you can talk about a session belonging to a user. Please explain. It seems to me that you can in theory encrypt the password by a key coming from user space, so that you need to know an additional key to resume the system, but that seems to me above and beyond what Secure Boot requires. Regards Oliver