Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4368951pxt; Wed, 11 Aug 2021 04:35:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWgmRz06hOCTR4Jd6spvLxJQzO3UpQpJ5HGKDisLy7POUIAjicLSkaExmWT6ffOWfpv5n7 X-Received: by 2002:a92:cc86:: with SMTP id x6mr59051ilo.119.1628681712382; Wed, 11 Aug 2021 04:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628681712; cv=none; d=google.com; s=arc-20160816; b=LYwKtGp/9uLYEEUmKXnGZrSlqy05TPtJwaSk1JU/o2ibbk7qHBajiIqAQZmPQ2cRMm yCccvo83CK78zDCV4RxPOII8MMzChHPM8yIC61TenLh8m9r7mWZpqzioB7JwyMuQnFF/ pOMwJCWImgRsDTScEP9OnnDWevTpA54RzQMUprwfd7i30uv2RgEZq/u2KP5SNZQi6JP0 yqPzm2e5xnQhAzT/FJ49RbARKz8vdaHCNTSyN0MU16bLgnjTfM9wLfTZTqkUANcsL4Gn Bjds60UMgk/JZDWVdLrJx/co1UZ2XbjnFFb0uljMnN7Sfbry/glAihoUhu8ga40B8gKx Hipw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=WKV0mifP9mdv8ecyMfTa0U/d4OeeOKmNT+j0H4eQvJk=; b=kItbJtWYAV6zmx5tNT2X4DD7zBI338V9cimRW1h7NqFGBEqWWSF6dd9KVXKhWtXmrF PbQj7epNryTMtnfjnbnW90hqs/VcphMtBmTQMDr+uCxb/lmeVwtQPzlpq+ijgbeL+p86 xIobR6aDJY9RDOZtUCSur+mTlgfYVyYAGZc1EMDSYeYVGKhrZ2ycQwgXwTkowyxwXWD8 EqfnZZal3XF3JGKnmSiJOAgr8lZ/DrfGkrACd7A1HXIoQVUqB5zgCUV14LyVq+VLILfC Lrz9r4z9S9PAJZzWsYHi4gEwmWxq6FJcB8xJ9agva5cZf37NOPNJgmPb38lXYJr4zci5 RPyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=hH9bPsD7; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n123si6612000iof.15.2021.08.11.04.34.52; Wed, 11 Aug 2021 04:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=hH9bPsD7; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237366AbhHKLfK (ORCPT + 99 others); Wed, 11 Aug 2021 07:35:10 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:8898 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237323AbhHKLfK (ORCPT ); Wed, 11 Aug 2021 07:35:10 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 17BBWsh8128241; Wed, 11 Aug 2021 07:34:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=WKV0mifP9mdv8ecyMfTa0U/d4OeeOKmNT+j0H4eQvJk=; b=hH9bPsD7c2pVAMfOhj4RRDHnxRRv2Bzx7DYgxiHRupsbbeBh6W+vBmIYsXxk1TG7Bhid 8rKKHR+Y3VJgFF8pCXs0D9awrfRW5aNEnOyWZkZ8UJBOmkeeO1Yc8cQB0kb8YeVe2TcN /FQVZtjPg+pAZleKOsrmjttH4PpR5qfi0LGJZ6eYAGJFgkhSJAcml1QQVcwvQfnEM+wQ InpRu/GmkR/GPCSqGcxORgZ84oGIAeys2hvhsZKAEr+H8tOGJuWrg+DAaz5P8Rj0PdzY AN5c28/RHpjrmcH1h7E0ys0KBnfFQ1p0G5M/PD+fcb6yMfjPKYZhLZLJEbbJbk23AYrv wg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3acbt3jyg6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Aug 2021 07:34:28 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 17BBYR1v138486; Wed, 11 Aug 2021 07:34:28 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 3acbt3jyeq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Aug 2021 07:34:27 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 17BBXGG5011004; Wed, 11 Aug 2021 11:34:25 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03ams.nl.ibm.com with ESMTP id 3a9ht8yxs0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Aug 2021 11:34:24 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 17BBYMo128377392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Aug 2021 11:34:22 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 73D28A4059; Wed, 11 Aug 2021 11:34:22 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 39878A404D; Wed, 11 Aug 2021 11:34:19 +0000 (GMT) Received: from li-f45666cc-3089-11b2-a85c-c57d1a57929f.ibm.com (unknown [9.160.27.84]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 11 Aug 2021 11:34:19 +0000 (GMT) Message-ID: Subject: Re: [PATCH v2] fscrypt: support trusted keys From: Mimi Zohar To: Jarkko Sakkinen , Eric Biggers Cc: Ahmad Fatoum , "Theodore Y. Ts'o" , Jaegeuk Kim , kernel@pengutronix.de, James Morris , "Serge E. Hallyn" , James Bottomley , Sumit Garg , David Howells , linux-fscrypt@vger.kernel.org, linux-crypto@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 11 Aug 2021 07:34:18 -0400 In-Reply-To: <20210811001743.ofzkwdwa6rcjsf4d@kernel.org> References: <20210806150928.27857-1-a.fatoum@pengutronix.de> <20210809094408.4iqwsx77u64usfx6@kernel.org> <20210810180636.vqwaeftv7alsodgn@kernel.org> <20210810212140.sdq5dq2wy5uaj7h7@kernel.org> <20210811001743.ofzkwdwa6rcjsf4d@kernel.org> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.28.5 (3.28.5-16.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: r6-4IUomzcvJFMnp_seKefxgZMrV5TsK X-Proofpoint-ORIG-GUID: 9YaVVr2iQJOX9DHzgWTnnrzbsVhn8PWv X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-08-11_04:2021-08-11,2021-08-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 mlxlogscore=751 adultscore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 clxscore=1011 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108110073 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, 2021-08-11 at 03:17 +0300, Jarkko Sakkinen wrote: > On Tue, Aug 10, 2021 at 02:27:24PM -0700, Eric Biggers wrote: > > On Wed, Aug 11, 2021 at 12:21:40AM +0300, Jarkko Sakkinen wrote: > > > On Tue, Aug 10, 2021 at 11:46:49AM -0700, Eric Biggers wrote: > > > > On Tue, Aug 10, 2021 at 09:06:36PM +0300, Jarkko Sakkinen wrote: > > > > > > > > > > > > > > I don't think this is right, or at least it does not follow the pattern > > > > > > > in [*]. I.e. you should rather use trusted key to seal your fscrypt key. > > > > > > > > > > > > What's the benefit of the extra layer of indirection over just using a "trusted" > > > > > > key directly? The use case for "encrypted" keys is not at all clear to me. > > > > > > > > > > Because it is more robust to be able to use small amount of trusted keys, > > > > > which are not entirely software based. > > > > > > > > > > And since it's also a pattern on existing kernel features utilizing trusted > > > > > keys, the pressure here to explain why break the pattern, should be on the > > > > > side of the one who breaks it. > > > > > > > > This is a new feature, so it's on the person proposing the feature to explain > > > > why it's useful. The purpose of "encrypted" keys is not at all clear, and the > > > > documentation for them is heavily misleading. E.g.: > > > > > > > > "user space sees, stores, and loads only encrypted blobs" > > > > (Not necessarily true, as I've explained previously.) > > > > > > > > "Encrypted keys do not depend on a trust source" ... "The main disadvantage > > > > of encrypted keys is that if they are not rooted in a trusted key" > > > > (Not necessarily true, and in fact it seems they're only useful when they > > > > *do* depend on a trust source. At least that's the use case that is being > > > > proposed here, IIUC.) > > > > > > > > I do see a possible use for the layer of indirection that "encrypted" keys are, > > > > which is that it would reduce the overhead of having lots of keys be directly > > > > encrypted by the TPM/TEE/CAAM. Is this the use case? If so, it needs to be > > > > explained. > > > > > > If trusted keys are used directly, it's an introduction of a bottleneck. > > > If they are used indirectly, you can still choose to have one trusted > > > key per fscrypt key. > > > > > > Thus, it's obviously a bad idea to use them directly. > > > > So actually explain that in the documentation. It's not obvious at all. And > > does this imply that the support for trusted keys in dm-crypt is a mistake? > > Looking at dm-crypt implementation, you can choose to use 'encrypted' key > type, which you can seal with a trusted key. > > Note: I have not been involved when the feature was added to dm-crypt. At least for TPM 1.2, "trusted" keys may be sealed to a PCR and then extended to prevent subsequent usage. For example, in the initramfs all of the "encrypted" keys could be decrypted by a single "trusted" key, before extending the PCR. Mimi