Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1177138ybh; Sat, 3 Aug 2019 19:52:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+K5LicvnzVle6TivNTx0NnJc7UJenlhl36uAFErV6NxJdBm062jGcWB9djWtx32Q85H9x X-Received: by 2002:a17:90a:a00d:: with SMTP id q13mr11500566pjp.80.1564887138685; Sat, 03 Aug 2019 19:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564887138; cv=none; d=google.com; s=arc-20160816; b=ujegMB63CzXHtgbyDOmBZHH0bb7gt00lJLV/qSK0jTSsMNU8VE3+aki19KsKUqtzJx WDgA7mghfKggQWrjaUqUEzGSdpQJX57Dyr1ZHl3obNSJSAkB+B/xoF5GyRFFDczStps9 EQpCJrmn95PHFrdS/m4F9i0uoUjFf9WolTwxYYyWwHpCxnxnJG/CSELBbdJrCvQsYkoo W3UoG/1fZOnGp3tQ93XfKgP82SSyFB5uZerpqG1oIwkg0LTH+Jt5lhKBBLwdV3LGCrIC Z4CwXoQ3fpADvEdU3EKmAWvb++IO6Lx42IjKj5CgLOhbHN9Mm8Wi7JgwWAquA5MLn04a AdnA== 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=viaK0h9tAGm9/vM25Q92xTuNqGXyRHZDVWxqlfOBDpw=; b=tK4db1tuwgfgCZNb1IXfERA3V4BlsbFUFrU2d+NGDzSEV5ezZ/dvLPe6sxjOQGtbzV 4qTKSBSaqOMVRPb3jB5ifCGsJySB9s2NehdHxf6125iLO2PU25dCLe23SElHToNLiKhI Kzc9V9amNuzy0XIdVC90FfyoGat8gxWoBcQprOtJsNRA0OG7ys7P5146atVmt2jJn2WU 9ltAWiaWFOB/LliUFPBGBKF6du2EiVBhX6if2AryoToh+1ux72989SGlzNIa1VC7KRYo 6KzsZIRNmKBwbHTdNnH+PcWXuMUvKI3qgw5Fe22t+RZDYcG5X7nMXNVv0r5Lbg2kJ/5c axxQ== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5si7601287pgp.299.2019.08.03.19.52.03; Sat, 03 Aug 2019 19:52:18 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394323AbfHBUfq (ORCPT + 99 others); Fri, 2 Aug 2019 16:35:46 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:35967 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732848AbfHBUfq (ORCPT ); Fri, 2 Aug 2019 16:35:46 -0400 Received: from 162-237-133-238.lightspeed.rcsntx.sbcglobal.net ([162.237.133.238] helo=elm) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hteH3-0006zl-Sv; Fri, 02 Aug 2019 20:35:38 +0000 Date: Fri, 2 Aug 2019 15:35:33 -0500 From: Tyler Hicks To: Jarkko Sakkinen Cc: Roberto Sassu , jejb@linux.ibm.com, zohar@linux.ibm.com, jgg@ziepe.ca, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, crazyt2019+lml@gmail.com, nayna@linux.vnet.ibm.com, silviu.vlasceanu@huawei.com Subject: Re: [PATCH] KEYS: trusted: allow module init if TPM is inactive or deactivated Message-ID: <20190802203532.GF26616@elm> References: <20190705163735.11539-1-roberto.sassu@huawei.com> <20190711194811.rfsohbfc3a7carpa@linux.intel.com> <20190801163215.mfkagoafkxscesne@linux.intel.com> <20190802142721.GA26616@elm> <20190802194226.oiztvme5klkmw6fh@linux.intel.com> <20190802202343.GE26616@elm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190802202343.GE26616@elm> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-08-02 15:23:43, Tyler Hicks wrote: > On 2019-08-02 22:42:26, Jarkko Sakkinen wrote: > > On Fri, Aug 02, 2019 at 09:27:22AM -0500, Tyler Hicks wrote: > > > On 2019-08-02 10:21:16, Roberto Sassu wrote: > > > > On 8/1/2019 6:32 PM, Jarkko Sakkinen wrote: > > > > > On Mon, Jul 15, 2019 at 06:44:28PM +0200, Roberto Sassu wrote: > > > > > > According to the bug report at https://bugs.archlinux.org/task/62678, > > > > > > the trusted module is a dependency of the ecryptfs module. We should > > > > > > load the trusted module even if the TPM is inactive or deactivated. > > > > > > > > > > > > Given that commit 782779b60faa ("tpm: Actually fail on TPM errors during > > > > > > "get random"") changes the return code of tpm_get_random(), the patch > > > > > > should be modified to ignore the -EIO error. I will send a new version. > > > > > > > > > > Do you have information where this dependency comes from? > > > > > > > > ecryptfs retrieves the encryption key from encrypted keys (see > > > > ecryptfs_get_encrypted_key()). > > > > > > That has been there for many years with any problems. It was added > > > in 2011: > > > > > > commit 1252cc3b232e582e887623dc5f70979418caaaa2 > > > Author: Roberto Sassu > > > Date: Mon Jun 27 13:45:45 2011 +0200 > > > > > > eCryptfs: added support for the encrypted key type > > > > > > What's recently changed the situation is this patch: > > > > > > commit 240730437deb213a58915830884e1a99045624dc > > > Author: Roberto Sassu > > > Date: Wed Feb 6 17:24:51 2019 +0100 > > > > > > KEYS: trusted: explicitly use tpm_chip structure from tpm_default_chip() > > > > > > Now eCryptfs has a hard dependency on a TPM chip that's working > > > as expected even if eCryptfs (or the rest of the system) isn't utilizing > > > the TPM. If the TPM behaves unexpectedly, you can't access your files. > > > We need to get this straightened out soon. > > > > I agree with this conclusion that eCryptfs needs to be fixed, not > > another workaround to trusted.ko. > > That wasn't the conclusion that I came to. I prefer Robert's proposed > change to trusted.ko. > > How do you propose that this be fixed in eCryptfs? > > Removing encrypted_key support from eCryptfs is the only way that I can > see to fix the bug in eCryptfs. That support has been there since 2011. > I'm not sure of the number of users that would be broken by removing > encrypted_key support. I don't think the number is high but I can't say > that confidently. AFAICT, this bug doesn't only affect eCryptfs. It also affects Intel nvdimm support starting with: commit 4c6926a23b76ea23403976290cd45a7a143f6500 Author: Dave Jiang Date: Thu Dec 6 12:40:01 2018 -0800 acpi/nfit, libnvdimm: Add unlock of nvdimm support for Intel DIMMs So without a workaround in trusted.ko, encrypted_key support will need to be removed from eCryptfs and nvdimm to address this issue. Tyler > > Roberto, what was your use case when you added encrypted_key support to > eCryptfs back then? Are you aware of any users of eCryptfs + > encrypted_keys? > > Jarkko, removing a long-standing feature is potentially more disruptive > to users than adding a workaround to trusted.ko which already requires a > similar workaround. I don't think that I agree with you on the proper > fix here. > > Tyler > > > > > /Jarkko