Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753471AbcK0HAK (ORCPT ); Sun, 27 Nov 2016 02:00:10 -0500 Received: from mail-pg0-f43.google.com ([74.125.83.43]:33226 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbcK0HAF (ORCPT ); Sun, 27 Nov 2016 02:00:05 -0500 Date: Sat, 26 Nov 2016 23:00:01 -0800 From: Eric Biggers To: David Gstir Cc: "Theodore Ts'o" , Richard Weinberger , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel , dedekind1@gmail.com, adrian.hunter@intel.com, jaegeuk@kernel.org, wd@denx.de, sbabic@denx.de, dengler@linutronix.de, mhalcrow@google.com, hch@infradead.org Subject: Re: [PATCH 05/29] fscrypt: Let fs select encryption index/tweak Message-ID: <20161127070001.GD34163@google.com> References: <1479072072-6844-1-git-send-email-richard@nod.at> <1479072072-6844-6-git-send-email-richard@nod.at> <20161115184354.GD127180@google.com> <98AAB80A-A0BE-4408-A514-DC3B8D19C5F7@sigma-star.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <98AAB80A-A0BE-4408-A514-DC3B8D19C5F7@sigma-star.at> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 961 Lines: 18 On Thu, Nov 24, 2016 at 04:57:51PM +0100, David Gstir wrote: > > > Also, if the intent is just that the 'index' represent the data's offset in > > filesystem blocks rather than in pages, then perhaps it should be documented as > > such. (This would be correct for ext4 and f2fs; they just happen to only > > support encryption with block_size = PAGE_SIZE currently.) > > Yes, in case of UBIFS it is exactly that. > > However, I'm actually not really happy with the name 'index'. I'd rather call it 'iv' (or 'tweak') directly. In the context of encryption its purpose will be more obvious, especially in regard to the "IV _must_ not be reused" constraint you mentioned above. > Well, the way I'd prefer to think about it is that the filesystem does not provide an IV directly (it doesn't anyway, since the actual IV is a u8[16]), but rather the number of the logical block of the file, like 'u64 lblk_num'. And that is sufficient to avoid IV reuse. Eric