Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5689630ybg; Tue, 22 Oct 2019 07:03:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMArTL+gNkXTOoG+nGv4fOUhlLxIsa73oyk/Jglu60dtq+p8tVA4PSbAkgZYVqH+9QnEmf X-Received: by 2002:a50:970e:: with SMTP id c14mr14182136edb.20.1571752995019; Tue, 22 Oct 2019 07:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571752995; cv=none; d=google.com; s=arc-20160816; b=f2oLEtYy+adXkvX7HaRidfuI/HiyVsgDAwNfKTha+VmXQXixa3qNdxWKstO0vN2aoV M4+IsAAbqhHgiHz3/eLLaLugMNSACbMiU21wGSfda1dxwlMUVS1zr2Y8JYhZNx9RvG3G 1bj2lDOPvBKKlWAMHm+pHF8cx3qzjz3PFRi7QsiRo64cM1n7hMvEC1PKZZfT6dtGwJMr EOn5sdL/BT+Zb9Z4kpieIx8QNi3773v3cPKaBGHC86XaioDD3cLHwWtBUyuiGRzzrQBA lcEN3XOPslEiTauKKzgwfLLA9Np6YadFEc6bXOBvFHKEEGAsad9wWVInN1GR0SKqUjet i7Ww== 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:to :from:date; bh=Zf5WAT/rodrig6SQ0X30l84kceZbfAM0si3X7WC0CZo=; b=UGIht8pAfq6REy0pAcjxQP3PqaFk//Z996yT/di5H3XnEa8nbOhZdUBwzV++qGgmO0 UVGMWXqsSOLdqsPQIe7+KeOaaUHHJMJpFtZoxun3YNIRfJlMHkJX7dCtT3smdSvOycK5 kLvAehwaxa8ees8nkvWDdQFs/BpF0PXlaFnrw0qiseU97FSaxvGWjRfRWndwviu1ZjcQ SaYTAvxWpjxwvZx/rVJK5609/d1jNSavVqhOUWOsusBZF4ETNBpyD4MKnPamjxhSg9rT HEaF8ZTLgFl3uXJ5t7F5foSiZBo7f0mkhPDcTuPdA7q7XOz7Q/O/L0yoN3VItfqlbuYJ 9Hxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 jz12si10513800ejb.193.2019.10.22.07.02.31; Tue, 22 Oct 2019 07:03:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731941AbfJVNa2 (ORCPT + 99 others); Tue, 22 Oct 2019 09:30:28 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:57480 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730981AbfJVNa2 (ORCPT ); Tue, 22 Oct 2019 09:30:28 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-98.corp.google.com [104.133.0.98] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x9MDU3no022015 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 09:30:04 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id E1AD6420456; Tue, 22 Oct 2019 09:30:01 -0400 (EDT) Date: Tue, 22 Oct 2019 09:30:01 -0400 From: "Theodore Y. Ts'o" To: Dave Chinner , linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Satya Tangirala , Paul Crowley , Paul Lawrence , Jaegeuk Kim Subject: Re: [PATCH 1/3] fscrypt: add support for inline-encryption-optimized policies Message-ID: <20191022133001.GA23268@mit.edu> References: <20191021230355.23136-1-ebiggers@kernel.org> <20191021230355.23136-2-ebiggers@kernel.org> <20191022052712.GA2083@dread.disaster.area> <20191022060004.GA333751@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191022060004.GA333751@sol.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Oct 21, 2019 at 11:00:04PM -0700, Eric Biggers wrote: > That won't work because we need consecutive file blocks to have consecutive IVs > as often as possible. The crypto support in the UFS and EMMC standards takes > only a single 64-bit "data unit number" (DUN) per request, which the hardware > uses as the first 64 bits of the IV and automatically increments for each data > unit (i.e. for each filesystem block, in this case). It seems very likely that for systems that are using UFS and eMMC (which are overwhelming lower-end devices --- e.g., embedded and mobile handsets) 32-bit inode and logical block numbers will be just fine. If and when we actually get inline crypto support for server-class systems, hopefully they will support 128-bit DUN's, and/or they will have sufficiently fast key load times such that we can use per-file keying. > An alternative which would work nicely on ext4 and xfs (if xfs supported > fscrypt) would be to pass the physical block number as the DUN. However, that > wouldn't work at all on f2fs because f2fs moves data blocks around. And since > most people who want to use this are using f2fs, f2fs support is essential. And that is something fscrypt supports already, so if people really did want to use 64-bit logical block numbers, they could do that, at the cost of giving up the ability to shrink the file system (which XFS doesn't support anyway....) - Ted