--- zzzz-none-000/linux-2.6.32.61/fs/ecryptfs/main.c 2013-06-10 09:43:48.000000000 +0000 +++ ar10-7272-687/linux-2.6.32.61/fs/ecryptfs/main.c 2010-04-08 11:00:21.000000000 +0000 @@ -212,8 +212,7 @@ ecryptfs_opt_passthrough, ecryptfs_opt_xattr_metadata, ecryptfs_opt_encrypted_view, ecryptfs_opt_fnek_sig, ecryptfs_opt_fn_cipher, ecryptfs_opt_fn_cipher_key_bytes, - ecryptfs_opt_unlink_sigs, ecryptfs_opt_check_dev_ruid, - ecryptfs_opt_err }; + ecryptfs_opt_unlink_sigs, ecryptfs_opt_err }; static const match_table_t tokens = { {ecryptfs_opt_sig, "sig=%s"}, @@ -228,7 +227,6 @@ {ecryptfs_opt_fn_cipher, "ecryptfs_fn_cipher=%s"}, {ecryptfs_opt_fn_cipher_key_bytes, "ecryptfs_fn_key_bytes=%u"}, {ecryptfs_opt_unlink_sigs, "ecryptfs_unlink_sigs"}, - {ecryptfs_opt_check_dev_ruid, "ecryptfs_check_dev_ruid"}, {ecryptfs_opt_err, NULL} }; @@ -272,7 +270,6 @@ * ecryptfs_parse_options * @sb: The ecryptfs super block * @options: The options pased to the kernel - * @check_ruid: set to 1 if device uid should be checked against the ruid * * Parse mount options: * debug=N - ecryptfs_verbosity level for debug output @@ -288,8 +285,7 @@ * * Returns zero on success; non-zero on error */ -static int ecryptfs_parse_options(struct super_block *sb, char *options, - uid_t *check_ruid) +static int ecryptfs_parse_options(struct super_block *sb, char *options) { char *p; int rc = 0; @@ -314,8 +310,6 @@ char *cipher_key_bytes_src; char *fn_cipher_key_bytes_src; - *check_ruid = 0; - if (!options) { rc = -EINVAL; goto out; @@ -416,9 +410,6 @@ case ecryptfs_opt_unlink_sigs: mount_crypt_stat->flags |= ECRYPTFS_UNLINK_SIGS; break; - case ecryptfs_opt_check_dev_ruid: - *check_ruid = 1; - break; case ecryptfs_opt_err: default: printk(KERN_WARNING @@ -496,7 +487,6 @@ } struct kmem_cache *ecryptfs_sb_info_cache; -static struct file_system_type ecryptfs_fs_type; /** * ecryptfs_fill_super @@ -561,8 +551,7 @@ * ecryptfs_interpose to create our initial inode and super block * struct. */ -static int ecryptfs_read_super(struct super_block *sb, const char *dev_name, - uid_t check_ruid) +static int ecryptfs_read_super(struct super_block *sb, const char *dev_name) { struct path path; int rc; @@ -572,22 +561,6 @@ 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; - } - - if (check_ruid && path.dentry->d_inode->i_uid != current_uid()) { - rc = -EPERM; - printk(KERN_ERR "Mount of device (uid: %d) not owned by " - "requested user (uid: %d)\n", - path.dentry->d_inode->i_uid, current_uid()); - 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; @@ -626,7 +599,6 @@ { int rc; struct super_block *sb; - uid_t check_ruid; rc = get_sb_nodev(fs_type, flags, raw_data, ecryptfs_fill_super, mnt); if (rc < 0) { @@ -634,12 +606,12 @@ goto out; } sb = mnt->mnt_sb; - rc = ecryptfs_parse_options(sb, raw_data, &check_ruid); + rc = ecryptfs_parse_options(sb, raw_data); if (rc) { printk(KERN_ERR "Error parsing options; rc = [%d]\n", rc); goto out_abort; } - rc = ecryptfs_read_super(sb, dev_name, check_ruid); + rc = ecryptfs_read_super(sb, dev_name); if (rc) { printk(KERN_ERR "Reading sb failed; rc = [%d]\n", rc); goto out_abort;