Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3277115imm; Mon, 6 Aug 2018 01:40:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe5oT0HeQkYlX0r4OjM6KL1Bc7/IDglrp729Hk9BqFtNdH96EYoiB/8CSaYkOm3o0OgqbIl X-Received: by 2002:a63:314f:: with SMTP id x76-v6mr13395385pgx.373.1533544836500; Mon, 06 Aug 2018 01:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533544836; cv=none; d=google.com; s=arc-20160816; b=qUlch1veEHFtORGmVlYSujzigmNX3Xfe0oICeyyGeNsxLFXwM5r6R1Vpuro6joBUcu hMW3gCSKVZr/h7UVOOP0EmXB4bHy82zlxBGraFm+X6V2ZzILkNNrc10QDB339G0yiFs4 wcQirGEl/Sivei2W0exkQ0EsHdOyzS5LML4PoqiTEenQqHhZdaSdchAoWtvB27WiBLx6 Gs6SIL1pjaWisZ8SuNGDRVctLNTd3HSApuK5AvadBOGF5H4OcOrrMsFPOeBaZdUDzjnk 09osKjt5p1HpzzBM3M7iiCzK/bMnINVmnK79RPpcTrXdQgF4Mh9XGKx/bSz+CjMmv2BM 90Uw== 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=vPdtRy9wkztGPi03kZLgg+vosk9xqCYge0QYmyeK9Ns=; b=HCpLKt3UJcTUzweNZFovKrJnyA4izcbaDVhpZqaDKcYOc6gBn0z2BiYBFXHsrfQpYH pBByBtLOv8XrTuRwc3Ul5e+w+d4MkiEhFBrjg6zIdwWVxEq0d9MDG3XDHWT8u1Uf2wXv QZMn+f33Ew3cVGukp1hLoXtwlN+EEtS4GrWg+M5QaEH4fM4zsZpqsPRiNfZaVDeMVmOu FVnrxeDII0URDcCy9xvYJv+mq/K6gqmZBIncKoVJjphkK+QTJRPYh/PdrUhcycmB94s6 J2Wc7CXUpqPEfIV5HUarrTICRzWRZTXXHxBMcqXS7+2ID+p4LPEFIyi9s7I4CxNWmxNV zmZQ== 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 l18-v6si13921608pfk.78.2018.08.06.01.40.21; Mon, 06 Aug 2018 01:40:36 -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 S1726939AbeHFKrU (ORCPT + 99 others); Mon, 6 Aug 2018 06:47:20 -0400 Received: from mga14.intel.com ([192.55.52.115]:54585 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbeHFKrU (ORCPT ); Mon, 6 Aug 2018 06:47:20 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2018 01:39:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,451,1526367600"; d="scan'208";a="251613960" Received: from chenyu-desktop.sh.intel.com (HELO chenyu-desktop) ([10.239.160.116]) by fmsmga005.fm.intel.com with ESMTP; 06 Aug 2018 01:39:18 -0700 Date: Mon, 6 Aug 2018 16:45:34 +0800 From: Yu Chen To: Pavel Machek Cc: Ryan Chen , jlee@suse.com, oneukum@suse.com, "Rafael J. Wysocki" , ebiggers@google.com, Theodore Ts'o , smueller@chronox.de, denkenz@gmail.com, Linux PM list , linux-crypto@vger.kernel.org, Linux Kernel Mailing List , kookoo.gu@intel.com, Zhang Rui Subject: Re: [PATCH 0/4][RFC v2] Introduce the in-kernel hibernation encryption Message-ID: <20180806084534.GB12124@chenyu-desktop> References: <20180720102532.GA20284@amd> <1532346156.3057.11.camel@suse.com> <20180723162302.GA4503@sandybridge-desktop> <1532590246.7411.3.camel@suse.com> <20180726081404.GG4244@linux-l9pv.suse> <20180730170415.GQ4244@linux-l9pv.suse> <20180803033702.GB416@sandybridge-desktop> <20180803053445.GC4244@linux-l9pv.suse> <20180805100200.GB22948@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180805100200.GB22948@amd> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, On Sun, Aug 05, 2018 at 12:02:00PM +0200, Pavel Machek wrote: > Hi! > > > > User space doesn't need to involve. The EFI root key is generated by > > > EFI boot stub and be transfer to kernel. It's stored in EFI boot service > > > variable that it can only be accessed by trusted EFI binary when > > > secure boot is enabled. > > > > > Okay, this apply to the 'suspend' phase, right? > > I'm still a little confused about the 'resume' phase. > > Taking encryption as example(not signature), > > the purpose of doing hibernation encryption is to prevent other users > > from stealing ram content. Say, user A uses a passphrase to generate the > > No, I don't think that's purpose here. > > Purpose here is to prevent user from reading/modifying kernel memory > content on machine he owns. > Say, A puts his laptop into hibernation and walks away, and B walks by, and opens A's laptop and wakes up the system and he can do what he wants. Although EFI key/TPM trusted key is enabled, currently there's no certification during resume, which sounds unsafe to me. Afterall, the original requirement is to probe user for password during resume, which sounds more natural. > Strange as it may sound, that is what "secure" boot requires (and what > Disney wants). > Ok, I understand this requirement, and I'm also concerning how to distinguish different users from seeing data of each other. Joey, I'm thinking of a possible direction which could take advantage of the password. It leverages either EFI key or TPM trusted key to get it done. Does it make sense? 1. The user space generates a symetric key key_user using the password, and passes the key_user to the kernel as the master key. 2. The kernel uses the EFI key or TPM trusted key to encrypt the key_user thus gets a encrypt_key. 3. Uses the encrypt_key to do snapshot encryption 4. During resume, the same encrypt_key is generated following the same steps(I assume the same EFI key or TPM key could be fetched during resumed, right?) and do the snapshot decryption. And this is what fscrypt is doing: Documentation/filesystems/fscrypt.rst Best, Yu > I guess it may have some non-evil uses, > too... https://www.linux.com/news/matthew-garrett-explains-how-increase-security-boot-time > > > Pavel > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html