Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5790445ybe; Tue, 10 Sep 2019 08:51:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgJj3SCHA/RixglKKTHkTh03Mf46KzVEI9SKWrVorT8K7OuOv/lKCOsqzgaGm0dw5a7REp X-Received: by 2002:a17:906:7c4e:: with SMTP id g14mr25814100ejp.103.1568130679780; Tue, 10 Sep 2019 08:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568130679; cv=none; d=google.com; s=arc-20160816; b=vDHBbZpHJqJn/Nm44Qrf14Tzj+PFLBQL187N4m8unUWYuLkQIhvz7RdvAZfnHINNks P+rnw5Uy/9hVczE9aQLEOkcOeDiQRPez7kBNjeo9De7JhW5+EYJLab1zv5xUBtTfIQPX nvgHZ/nRVEBs1JdXxIXnoA0Q4ty+khLNA8LlDeOzYKd7kh88POjpHa4zCmOdCj3pkfZW L6zP9HOn/iRw1EaVQmPzsjq27CKl6rE+P47pNI9XXIYx2xOK3vBmsPCpPOn6Feix1MVS o4KrI6YrEGsitsrLd2MU8PeQ57AbqpGpNxgjAUQxCdyRMcCLsv4a0tpR7/K/8Y5/os87 LZGg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LbB+YdgFNMCF7YfTBtvBYR5NjPpL5HcUzGji0CjiWxM=; b=auXJBxfmDXM/xDbQpHGbpUHfsn/VZ1NCMU+nr3hB4ua0Rz3+A6PSbIzEhEZhLRDrtp WDPjPCJ7v5sjE74UWfeVy2bEbsuTfAjPaB8uGb4GoHVpABckRO/RsfmKol3gTTAFTCEf uW2na1T2rWoXyK/HlpOvnx/pns8LcRI+DRd6k+4xzyeMWFR1gepCpIzu3qs/C2aZoy+B TSt6u8kvtiSoh29MxqSnN3U+youd60qYVeyisSWi4nqykx8CH4OTntE/2dp5EVVSE2UU Q5lEj/HQO+EfdLtSPwUac1qvn2YLp+RmBsNohy/auCV8YeFn7sJNUq1krCfTbCnmB5B0 b/bQ== 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 i14si9736983ejb.271.2019.09.10.08.50.56; Tue, 10 Sep 2019 08:51:19 -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 S2436564AbfIJPuN (ORCPT + 99 others); Tue, 10 Sep 2019 11:50:13 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57512 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732013AbfIJPuM (ORCPT ); Tue, 10 Sep 2019 11:50:12 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8AFlgLL008223; Tue, 10 Sep 2019 11:50:05 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uxcvdkupq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Sep 2019 11:50:05 -0400 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8AFlkhj008433; Tue, 10 Sep 2019 11:50:03 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uxcvdkunx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Sep 2019 11:50:02 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8AFo1Kt017117; Tue, 10 Sep 2019 15:50:01 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma02dal.us.ibm.com with ESMTP id 2uv467aw3b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Sep 2019 15:50:01 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8AFo02f46465320 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Sep 2019 15:50:00 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 80678112066; Tue, 10 Sep 2019 15:50:00 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3C283112064; Tue, 10 Sep 2019 15:49:57 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.102.1.89]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 10 Sep 2019 15:49:56 +0000 (GMT) From: Chandan Rajendra To: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fscrypt@vger.kernel.org Cc: Chandan Rajendra , tytso@mit.edu, adilger.kernel@dilger.ca, ebiggers@kernel.org, hch@infradead.org, chandanrlinux@gmail.com Subject: [PATCH RESEND V5 6/7] ext4: Enable encryption for subpage-sized blocks Date: Tue, 10 Sep 2019 21:21:14 +0530 Message-Id: <20190910155115.28550-7-chandan@linux.ibm.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190910155115.28550-1-chandan@linux.ibm.com> References: <20190910155115.28550-1-chandan@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-10_11:,, 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-1909100149 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