Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp528623ybl; Thu, 15 Aug 2019 23:17:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDIFVjwzdydy9sqYaOEQngQxfZdXBW4oYFJfh4k5znS9Frw17BchPvMf5ZfjmcbyRLyJjB X-Received: by 2002:a17:90a:b30f:: with SMTP id d15mr5612731pjr.19.1565936254612; Thu, 15 Aug 2019 23:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565936254; cv=none; d=google.com; s=arc-20160816; b=0FjQ6rBG+o1XC1ZM/n/O6n9xgwiIrdDR9MPqQl69FybLaIa1u/vV5tQIWg0wb9P9m3 49Dw7o/ODDHXJBCb+nGvXrVrnsJ0jEiwAo3aqMbspZCF2ZFRoX71xLHTOb6zAtOkvhG2 i8k0M/qCzSm5Oj8HYoNsSDvzWDcHV6xJTagR2CK7NQuK9i46SSDqU53o6gdOK5mTUesI cj4UGfK9ps6LdwXuUXDE5iukU0C3VNVjZFZt0i+qfNiZIyfufXc+iCnjKs1n+tYDsHlj hYsYHBRmLL+BbZ1f98bYW4W7A/jJQf5v8g1GQKk7gM3f8jEdCyFgQO99CH0QI7u/nt9U nkAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=LbB+YdgFNMCF7YfTBtvBYR5NjPpL5HcUzGji0CjiWxM=; b=0Ch6I/MbDAzU4KlqJm5ywrRjvgd7G3/fWQOEOdFLae+evoN36yYvrYF37Ew/8f0mQh AQgMgvndaK+6o99w9khco4ItZVUyloz/lEoGn9SfHoDcLfmUmFNfmOiH64uch8JChg45 3DxWBOXMVfeNIlI23B1Q5+DmKajDT6Bv3g5fuX4+IvLu0nbJjDmIlMYeC6mSKT+rqgjZ 3Kd4pT4AMn2dQPI588zM9HWex38TZo+66VMK3oM0dhqrqNX31CYilHp0uJduAyXG4a9C j8HJ0uYkuIc8fDlfuxJo74/DTNxZ1ZwUmTxOrtv0RRoZdVvu4LRQ5sWUpi20mtMDffAz KifQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7si3194256pgi.127.2019.08.15.23.17.20; Thu, 15 Aug 2019 23:17:34 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbfHPGRQ (ORCPT + 99 others); Fri, 16 Aug 2019 02:17:16 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57148 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726591AbfHPGRP (ORCPT ); Fri, 16 Aug 2019 02:17:15 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7G6HEBw043135 for ; Fri, 16 Aug 2019 02:17:14 -0400 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0a-001b2d01.pphosted.com with ESMTP id 2udnkwjrad-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 16 Aug 2019 02:17:14 -0400 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Aug 2019 07:17:08 +0100 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 16 Aug 2019 07:17:03 +0100 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7G6H2uL51970356 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Aug 2019 06:17:02 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8B3A8112062; Fri, 16 Aug 2019 06:17:02 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9DCA311206B; Fri, 16 Aug 2019 06:16:59 +0000 (GMT) Received: from localhost.in.ibm.com (unknown [9.124.35.23]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 16 Aug 2019 06:16:59 +0000 (GMT) From: Chandan Rajendra To: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org Cc: Chandan Rajendra , chandanrmail@gmail.com, tytso@mit.edu, adilger.kernel@dilger.ca, ebiggers@kernel.org, jaegeuk@kernel.org, yuchao0@huawei.com, hch@infradead.org Subject: [PATCH V4 7/8] ext4: Enable encryption for subpage-sized blocks Date: Fri, 16 Aug 2019 11:48:03 +0530 X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190816061804.14840-1-chandan@linux.ibm.com> References: <20190816061804.14840-1-chandan@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19081606-0064-0000-0000-00000409173E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011597; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000287; SDB=6.01247516; UDB=6.00658410; IPR=6.01029025; MB=3.00028195; MTD=3.00000008; XFM=3.00000015; UTC=2019-08-16 06:17:06 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081606-0065-0000-0000-00003EAFDA83 Message-Id: <20190816061804.14840-8-chandan@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-16_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908160067 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Now that we have the code to support encryption for subpage-sized blocks, this commit removes the conditional check in filesystem mount code. The commit also changes the support statement in Documentation/filesystems/fscrypt.rst to reflect the fact that encryption of filesystems with blocksize less than page size now works. Signed-off-by: Chandan Rajendra --- Documentation/filesystems/fscrypt.rst | 4 ++-- fs/ext4/super.c | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Documentation/filesystems/fscrypt.rst b/Documentation/filesystems/fscrypt.rst index 08c23b60e016..c3efe86bf2b2 100644 --- a/Documentation/filesystems/fscrypt.rst +++ b/Documentation/filesystems/fscrypt.rst @@ -213,8 +213,8 @@ Contents encryption ------------------- For file contents, each filesystem block is encrypted independently. -Currently, only the case where the filesystem block size is equal to -the system's page size (usually 4096 bytes) is supported. +Starting from Linux kernel 5.4, encryption of filesystems with block +size less than system's page size is supported. Each block's IV is set to the logical block number within the file as a little endian number, except that: diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 5b92054bf8ea..d580e71ad9c7 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4322,13 +4322,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) } } - if ((DUMMY_ENCRYPTION_ENABLED(sbi) || ext4_has_feature_encrypt(sb)) && - (blocksize != PAGE_SIZE)) { - ext4_msg(sb, KERN_ERR, - "Unsupported blocksize for fs encryption"); - goto failed_mount_wq; - } - if (DUMMY_ENCRYPTION_ENABLED(sbi) && !sb_rdonly(sb) && !ext4_has_feature_encrypt(sb)) { ext4_set_feature_encrypt(sb); -- 2.19.1