Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4870709ybg; Mon, 21 Oct 2019 16:07:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1fqZXRRfC7iiDSgRPvCh/Q1NT8Yyf8JGXqh0EE0CgxnjYAg0OUoHEH5lEjXRaRzDoazb0 X-Received: by 2002:a17:906:4d5a:: with SMTP id b26mr24387576ejv.157.1571699276233; Mon, 21 Oct 2019 16:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571699276; cv=none; d=google.com; s=arc-20160816; b=M1Rb2CA3Nz3NL9xlfzBAgaTM7g59D4LPby7Bg4pk5knbr8ce3CifHMzzGmzaGOAFw/ ijI+7afAY0AkGo5+ne6r4fABx1ns+1B2/aJSx6pX3QAMJQxH49aYHr5NSdLEY3/FU0oB 8fPzdulkuVfsHA32vtro9J+IsdAXcEMHX32zt5xDT/JQzUNRoZpryCxVq1AqH3FesLUs qEi2RQyayTNAx8FKl2Er74j63HqcUOtECs2lw15n4zD/xpcW6BxJXCJfJHGdwwvpk+dl R0PvqmmasdEG8atR925v5JGfjNha1+O1ST04E2RKm9JvYLd/Ov8np8GuBTnMcmsxzsen 6l7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=etEiCtfrTlCjrPUc0CX+ZxcbeglYBiC+EqMURFd7jpo=; b=oKWU6pZfR9MeoMSIOQMaWoGKzMQf44yxiBib+hPskATuFUfozbRJfpTxbEbLrw25ci ney5OuHfwtrzPKL5l0XePO0vwuGpWGsxqnTd0Wmax2WCntH9aGggZCebS7XYCiAHDf7n kVuugZD5yYEkTnWL91OT6yDuDSanNON3fb75mOhjpy9iw4wFa+hnc4iKGuKiPTeIDrBH LbAXwRHMCRHt1jAh4dMHrYLTb7lij5kRTGzHmCNKPfrKjgt9FRroSzdDqg9iXn2ApYmt 51rIDCa7XkqiUrSXjbNEtVKWFa70WrEd5OKZ2YW0jCjBPN1x6TuYuInL9y+jevC7r2YQ s8TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KFqCooku; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13si9966161edy.320.2019.10.21.16.07.28; Mon, 21 Oct 2019 16:07:56 -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; dkim=pass header.i=@kernel.org header.s=default header.b=KFqCooku; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730436AbfJUXHX (ORCPT + 99 others); Mon, 21 Oct 2019 19:07:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:36736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730069AbfJUXHX (ORCPT ); Mon, 21 Oct 2019 19:07:23 -0400 Received: from ebiggers-linuxstation.mtv.corp.google.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C812F2086D; Mon, 21 Oct 2019 23:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571699242; bh=Pe7Lis/ulx8/IwkmeLuv53LKYhthEU3xhU7qcvrWXZ8=; h=From:To:Cc:Subject:Date:From; b=KFqCookuLvhUWmmwBtVb2etKPO0Oto0GcX9cwodQRQNs2/xlaPbje2qinGny1YdhG 34Z6+AuL/AuHZ/lDvAKibQh0ft7asFQOQiIoMfRwwMVndg90X1oJg9z7TTsgGx/cQ9 3FPe8cmn2ZRnZyEzQrXJ9OGqx45lrhuB5zRNyYLI= From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Satya Tangirala , Paul Crowley , Paul Lawrence , "Theodore Y . Ts'o" , Jaegeuk Kim Subject: [PATCH 0/3] fscrypt: support for inline-encryption-optimized policies Date: Mon, 21 Oct 2019 16:03:52 -0700 Message-Id: <20191021230355.23136-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hello, In preparation for adding inline encryption support to fscrypt, this patchset adds a new fscrypt policy flag which modifies the encryption to be optimized for inline encryption hardware compliant with the UFS standard --- specifically, to use a smaller number of keys while still using at most 64 IV bits. This required adding the inode number to the IVs. For ext4, this precludes filesystem shrinking, so I've also added a compat feature which will prevent the filesystem from being shrunk. I've separated this from the full "Inline Encryption Support" patchset (https://lkml.kernel.org/linux-fsdevel/20190821075714.65140-1-satyat@google.com/) to avoid conflating an implementation (inline encryption) with a new on-disk format (INLINE_CRYPT_OPTIMIZED). This patchset purely adds support for INLINE_CRYPT_OPTIMIZED policies to fscrypt, but implements them using the existing filesystem layer crypto. We're planning to make the *implementation* (filesystem layer or inline crypto) be controlled by a mount option '-o inlinecrypt'. This patchset applies to fscrypt.git#master and can also be retrieved from https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=inline-crypt-optimized-v1 A ciphertext verification test for INLINE_CRYPT_OPTIMIZED policies can be found at https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/xfstests-dev.git/log/?h=inline-encryption Work-in-progress patches for the inline encryption implementation of both INLINE_CRYPT_OPTIMIZED and regular policies can be found at https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=inline-encryption-wip Eric Biggers (3): fscrypt: add support for inline-encryption-optimized policies ext4: add support for INLINE_CRYPT_OPTIMIZED encryption policies f2fs: add support for INLINE_CRYPT_OPTIMIZED encryption policies Documentation/filesystems/fscrypt.rst | 53 +++++++++++++++++++-------- fs/crypto/crypto.c | 11 +++++- fs/crypto/fscrypt_private.h | 20 +++++++--- fs/crypto/keyring.c | 6 ++- fs/crypto/keysetup.c | 47 +++++++++++++++++++----- fs/crypto/policy.c | 42 ++++++++++++++++++++- fs/ext4/ext4.h | 2 + fs/ext4/super.c | 14 +++++++ fs/f2fs/super.c | 26 ++++++++++--- include/linux/fscrypt.h | 3 ++ include/uapi/linux/fscrypt.h | 15 ++++---- 11 files changed, 191 insertions(+), 48 deletions(-) -- 2.23.0.866.gb869b98d4c-goog