From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65C10C433E0 for ; Tue, 19 May 2020 11:13:42 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F42420708; Tue, 19 May 2020 11:13:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="CrPd3dz1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="iMuWV7p/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F42420708 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mit.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jb0Bo-0007Ic-PD; Tue, 19 May 2020 11:13:40 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb0Bm-0007IN-L0 for linux-f2fs-devel@lists.sourceforge.net; Tue, 19 May 2020 11:13:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=eZ3BL18EyYjbz6lR6beZ2UCVFCt/tIvIP7u9i4MADmg=; b=CrPd3dz1FArHvxZk0toaZaQOig Eu3mS7aMZGPOKYDKC6NkWjcC7uViwUj0VXvXZIhgrn4hVhiOalfo4v0WSmsZ5typ/ub4H5BP3CwSy M9q1+FvBp6LHazjWrZ85H5BO5ovd6ObgbiPtgNGZ6wMnS00kz5R12vASuDG0T6IU+yXo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=eZ3BL18EyYjbz6lR6beZ2UCVFCt/tIvIP7u9i4MADmg=; b=iMuWV7p/npCrDCohuq+eJTcoYi UrJgAU9RPa/ESRaiweVLPEmlko2ql+6RoIDe9ldI648tj0XNaILKXhHH6S6C+JHpgW5kBIOdqGt3F o5vSYtc8FivoFBecD7jPea9j2ICOaix7PKN7v2PPHo/ZDwXpwfLVqXWVe9OOZ0MqRDpE=; Received: from outgoing-auth-1.mit.edu ([18.9.28.11] helo=outgoing.mit.edu) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jb0Bh-007G2f-W6 for linux-f2fs-devel@lists.sourceforge.net; Tue, 19 May 2020 11:13:38 +0000 Received: from callcc.thunk.org (pool-100-0-195-244.bstnma.fios.verizon.net [100.0.195.244]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 04JBDLpS006587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 May 2020 07:13:22 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 5513F420304; Tue, 19 May 2020 07:13:21 -0400 (EDT) Date: Tue, 19 May 2020 07:13:21 -0400 From: "Theodore Y. Ts'o" To: Eric Biggers Message-ID: <20200519111321.GE2396055@mit.edu> References: <20200515204141.251098-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200515204141.251098-1-ebiggers@kernel.org> X-Headers-End: 1jb0Bh-007G2f-W6 Subject: Re: [f2fs-dev] [PATCH] fscrypt: add support for IV_INO_LBLK_32 policies X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Satya Tangirala , linux-mmc@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, linux-crypto@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org, Paul Crowley Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Fri, May 15, 2020 at 01:41:41PM -0700, Eric Biggers wrote: > From: Eric Biggers > > The eMMC inline crypto standard will only specify 32 DUN bits (a.k.a. IV > bits), unlike UFS's 64. IV_INO_LBLK_64 is therefore not applicable, but > an encryption format which uses one key per policy and permits the > moving of encrypted file contents (as f2fs's garbage collector requires) > is still desirable. > > To support such hardware, add a new encryption format IV_INO_LBLK_32 > that makes the best use of the 32 bits: the IV is set to > 'SipHash-2-4(inode_number) + file_logical_block_number mod 2^32', where > the SipHash key is derived from the fscrypt master key. We hash only > the inode number and not also the block number, because we need to > maintain contiguity of DUNs to merge bios. > > Unlike with IV_INO_LBLK_64, with this format IV reuse is possible; this > is unavoidable given the size of the DUN. This means this format should > only be used where the requirements of the first paragraph apply. > However, the hash spreads out the IVs in the whole usable range, and the > use of a keyed hash makes it difficult for an attacker to determine > which files use which IVs. > > Besides the above differences, this flag works like IV_INO_LBLK_64 in > that on ext4 it is only allowed if the stable_inodes feature has been > enabled to prevent inode numbers and the filesystem UUID from changing. > > Signed-off-by: Eric Biggers Reviewed-by: Theodore Ts'o I kind of wish we had Kunit tests with test vectors, but that's for another commit I think. - Ted _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel