Re: [PATCH] ext4 crypto: prevent mount when blocksize != pagesize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 12, 2015 at 12:12:47AM +0900, Seunghun Lee wrote:
> Encryption mode is unsupported when blocksize != pagesize.
> 
> Signed-off-by: Seunghun Lee <waydi1@xxxxxxxxx>

This only checks for blocksize != pagesize in the case where the test
dummy encryption mount option is given.  We need to check also for the
case when the file system has the encryption feature set.  So this is
the better check.

						- Ted

commit 660947160c07e42b6c5def33a1977da09567ed55
Author: Theodore Ts'o <tytso@xxxxxxx>
Date:   Fri Jun 12 23:44:33 2015 -0400

    ext4 crypto: fail the mount if blocksize != pagesize
    
    We currently don't correctly handle the case where blocksize !=
    pagesize, so disallow the mount in those cases.
    
    Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 31e85be..e13fe40 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4065,7 +4065,15 @@ no_journal:
 		}
 	}
 
-	if (unlikely(sbi->s_mount_flags & EXT4_MF_TEST_DUMMY_ENCRYPTION) &&
+	if ((DUMMY_ENCRYPTION_ENABLED(sbi) ||
+	     EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_ENCRYPT)) &&
+	    (blocksize != PAGE_CACHE_SIZE)) {
+		ext4_msg(sb, KERN_ERR,
+			 "Unsupported blocksize for fs encryption");
+		goto failed_mount_wq;
+	}
+
+	if (DUMMY_ENCRYPTION_ENABLED(sbi) &&
 	    !(sb->s_flags & MS_RDONLY) &&
 	    !EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_ENCRYPT)) {
 		EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_ENCRYPT);
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux