From f4ce3c2dba928e9f31736465de24421c88142c08 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 17 May 2010 00:59:46 -0400 Subject: [PATCH] --- yaml --- r: 197993 b: refs/heads/master c: 4403158ba295c8e36f6736b1bb12d0f7e1923dac h: refs/heads/master i: 197991: ba3d3fdd4b0e21eb7f40217f73f4e4be82dc26b3 v: v3 --- [refs] | 2 +- trunk/fs/ecryptfs/main.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 230eff285ff8..d977f4f282f7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ab9a79b9669c28734a69fa9384df6fb93152e53a +refs/heads/master: 4403158ba295c8e36f6736b1bb12d0f7e1923dac diff --git a/trunk/fs/ecryptfs/main.c b/trunk/fs/ecryptfs/main.c index 7d3ed6bfcfa5..cbd4e18adb20 100644 --- a/trunk/fs/ecryptfs/main.c +++ b/trunk/fs/ecryptfs/main.c @@ -483,6 +483,7 @@ static int ecryptfs_parse_options(struct ecryptfs_sb_info *sbi, char *options) } struct kmem_cache *ecryptfs_sb_info_cache; +static struct file_system_type ecryptfs_fs_type; /** * ecryptfs_read_super @@ -503,6 +504,13 @@ static int ecryptfs_read_super(struct super_block *sb, const char *dev_name) ecryptfs_printk(KERN_WARNING, "path_lookup() failed\n"); goto out; } + if (path.dentry->d_sb->s_type == &ecryptfs_fs_type) { + rc = -EINVAL; + printk(KERN_ERR "Mount on filesystem of type " + "eCryptfs explicitly disallowed due to " + "known incompatibilities\n"); + goto out_free; + } ecryptfs_set_superblock_lower(sb, path.dentry->d_sb); sb->s_maxbytes = path.dentry->d_sb->s_maxbytes; sb->s_blocksize = path.dentry->d_sb->s_blocksize;