Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4017222ybg; Fri, 25 Oct 2019 12:08:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEc1a48PPlaA1lvIM+FxS9/Oxh0VJOpdzKh2vrS3t3dB8VXR/+8l6lf0Ad5TXC+6wG0AC1 X-Received: by 2002:a17:906:86d5:: with SMTP id j21mr4997222ejy.219.1572030539503; Fri, 25 Oct 2019 12:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572030539; cv=none; d=google.com; s=arc-20160816; b=yWzFFRvKsvv8MsXlVJGsQGIxTEBr0ooGNy0khr8eMqfrtY1iFlOs3i9kJTu5AkI6s5 o0hui8lK4loCE8kp5qgmlLzBlq4huf9oSEfk+fYIERk7BLAqQ53pAE/oRfbezkv29znS r22qmkUtlmYHqIitk3AbnPMALbe4MOZ7w6igNzI6bpIP98AmLu3tfmoL0jIOcIebSCB2 ncruTPvaUzHO3yoOx8EUGaGfR/QYUq4trE4qkU5+Cdm/z+Vq1l4s/y7VOzabnz4HZQ7X f9/OLe5wY8aWe4aF9J7pN0fpFw1cFCQIJRDnPWOwj2qIuvMI1oaxPF86FFQdlbyBnjs2 lk/w== 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=cGsasWdzPRXrVop5PQEHsG0xb15gbX34dr6VNhAf/4I=; b=Zf4rKJKo8o74zfh9KyObszv6eiBy/o3GCknyNqLRyBxboTn4NT5mYmVtnml2BdfrxW HspAYkdXEjDph6ivQdPAKebneiVAxB/Ymp+0EJgJIMT34z25s9pBYLKOPJod0IkGX664 CXjkU26ON7aYibJ0p4TX7rG5H1H0Vh+SMFiAQEIShlU7YLJ3n6beit59bRSuvWc2JLVo sl6auCvorehoVJGwoZkmtoq7iB63Y3QOL6T7DAXzae49kjl2t0W0q/7d6i+2qbUGKmwn MmEqisPA1Alfq6QAviJGGHBVlN2/Oj2SWnducTTlB4GcZenCxIsU4KepLjI3ZDnO8KYa mbLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tYsduxAC; 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 k35si2053989edb.84.2019.10.25.12.08.35; Fri, 25 Oct 2019 12:08:59 -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=tYsduxAC; 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 S1729769AbfJXV5J (ORCPT + 99 others); Thu, 24 Oct 2019 17:57:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:57122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726279AbfJXV5J (ORCPT ); Thu, 24 Oct 2019 17:57:09 -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 4995620578; Thu, 24 Oct 2019 21:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571954227; bh=HDbyy92ncxjP1dI6FxrpY5/nE4vCNb78sIDmKUaw/oA=; h=From:To:Cc:Subject:Date:From; b=tYsduxACwWAZcKMN50EsIXij5SWgunEH/IZT5C2so19z1/o5XTkDSDkgsUcfYdjGT cYMAHDf8Q8CG1ftEildMrnVdoOBdnctFicyjkPr72LbPTbeOJgZh0wEtry6JZY/j+I kCMv9S3xpWh1jvarxrgWjGDKupV8ex7ClSaq4Hg0= 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 v2 0/3] fscrypt: support for IV_INO_LBLK_64 policies Date: Thu, 24 Oct 2019 14:54:35 -0700 Message-Id: <20191024215438.138489-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-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 v2.1 standard or the upcoming version of the eMMC standard. This means using per-mode keys instead of per-file keys, and in compensation including the inode number in 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 (IV_INO_LBLK_64). This patchset purely adds support for IV_INO_LBLK_64 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-v2 I've written a ciphertext verification test for this new type of policy: 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 IV_INO_LBLK_64 and regular policies can be found at https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=inline-encryption-wip Changes v1 => v2: - Rename the flag from INLINE_CRYPT_OPTIMIZED to IV_INO_LBLK_64. - Use the same key derivation and IV generation scheme for filenames encryption too. - Improve the documentation and commit messages. Eric Biggers (3): fscrypt: add support for IV_INO_LBLK_64 policies ext4: add support for IV_INO_LBLK_64 encryption policies f2fs: add support for IV_INO_LBLK_64 encryption policies Documentation/filesystems/fscrypt.rst | 63 +++++++++++++++++---------- fs/crypto/crypto.c | 10 ++++- fs/crypto/fscrypt_private.h | 16 +++++-- fs/crypto/keyring.c | 6 ++- fs/crypto/keysetup.c | 45 ++++++++++++++----- fs/crypto/policy.c | 41 ++++++++++++++++- 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 | 3 +- 11 files changed, 182 insertions(+), 47 deletions(-) -- 2.24.0.rc0.303.g954a862665-goog