Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3908171pxt; Tue, 10 Aug 2021 14:28:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc1HkVGqjXOSOvemxLvKaszFAWjZrmtLEKAXAlWl0/grPUUkyPinTB3Kg323jaiMhDeImQ X-Received: by 2002:a17:906:c831:: with SMTP id dd17mr511725ejb.143.1628630885851; Tue, 10 Aug 2021 14:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628630885; cv=none; d=google.com; s=arc-20160816; b=g+yvmqyhGrDV9F7EafwPQZyUF4OPjfy9T3A+1kl8nEbmTV4hTiVI237VJi8qTff74n vhDk+ezPDwMervHQV0/Rl1Kli2fmSc8wy36KEKjZgI5qMJJ0x4QoTbdU9VbskERcGtTG rz5aPsnaB7DxZ51gHWVJz69NmfoDCS9FZikyNvJO2Ikk/dHbi+aPnOGtgDUSYwYY2B3Q G9O8yHUmtnSgU9vyiXtliXZpw+AbZzP261T9Z/aSAruDUfJpUWASfUvETW4VE7lSAtj0 rqXHCXLJ95+M+/xKTLzvtEJbPYjuqEDkl2OEIJRxB/B33S/cf2EnaMwuwkf9nBz0dpUj xM5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DZYunNJFOqNvGJwwKw9bvjCTUe4O2taV1K15HWiy4L0=; b=TuvDJstEoWzp78Il15XGYGmpMcsXlnTzntG+UDhLnrG1vGgvj58wJMmlDweTCIuYEG MIDNoTofbTe/IbuHn4X04w5GkyYmRJ9h4yzzSO0ohdUjTXs8vERSkq2i/U8oWZgD/C7e M2EupOn3M4bHsIfmcuELJYh0LEfBYFsro+bE7ojvbpeW7DCCGqsfAs92NXxBDgr/R8jr nAWN2f3hf1hN+15k3M4a2S9qAljEwrUdW3YAu2XPQyiH0Hkwi8kCR7OX1Yj2/0oW6AVx LMnqExjfyFAhv+W72RCNZnvzpKdLdhFiupWxVILvEaDsk9/LA/ZeDVn/hlgicYlvHi5W Ep1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VGuJpX+X; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb14si25174004ejc.608.2021.08.10.14.27.41; Tue, 10 Aug 2021 14:28:05 -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=@kernel.org header.s=k20201202 header.b=VGuJpX+X; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234531AbhHJV14 (ORCPT + 99 others); Tue, 10 Aug 2021 17:27:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233968AbhHJV1w (ORCPT ); Tue, 10 Aug 2021 17:27:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A87D061019; Tue, 10 Aug 2021 21:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628630846; bh=mjloMTiIdTRuQibK5edGwphq2JrQh540Z20LUrsqdPo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VGuJpX+XfmOQoRt/Z+ROdsbw47SJelREzPoqRjL8ak10G0aAanUW0x4ixMkmgh3LF REkjaE+noiZ2oAGLK3t1Dn/PvsrdIlylne3+omQVNFoexbRLXgs5r5EfpvY1efuUZp swc91rXKmS1s+kOSeo0dB8YjlDd03c8KhP0YymmmjDlaGy6KBCpDal6CYQlUNaQ3gw wRMlrxdaJmxvZi96/3b1sGfClbJbtKt62m3FpDFja7Gh8AqeS9MwvNHzJPHxgr7xqx 5zA+PAuRxtBj1ge3DqIM8sSfLiPHsr5VDwkfq/nkUm1qCmMyWQ5TMwUteiomQjr8Xg cxU3UDalnpsJg== Date: Tue, 10 Aug 2021 14:27:24 -0700 From: Eric Biggers To: Jarkko Sakkinen Cc: Ahmad Fatoum , "Theodore Y. Ts'o" , Jaegeuk Kim , kernel@pengutronix.de, James Morris , "Serge E. Hallyn" , James Bottomley , Mimi Zohar , 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 Subject: Re: [PATCH v2] fscrypt: support trusted keys Message-ID: References: <20210806150928.27857-1-a.fatoum@pengutronix.de> <20210809094408.4iqwsx77u64usfx6@kernel.org> <20210810180636.vqwaeftv7alsodgn@kernel.org> <20210810212140.sdq5dq2wy5uaj7h7@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210810212140.sdq5dq2wy5uaj7h7@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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? - Eric