aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ecryptfs/main.c5
-rw-r--r--fs/ecryptfs/messaging.c5
-rw-r--r--init/Kconfig1
3 files changed, 5 insertions, 6 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 2768138eefe..1d6ce91b706 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -544,11 +544,12 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags
544 goto out_free; 544 goto out_free;
545 } 545 }
546 546
547 if (check_ruid && path.dentry->d_inode->i_uid != current_uid()) { 547 if (check_ruid && !uid_eq(path.dentry->d_inode->i_uid, current_uid())) {
548 rc = -EPERM; 548 rc = -EPERM;
549 printk(KERN_ERR "Mount of device (uid: %d) not owned by " 549 printk(KERN_ERR "Mount of device (uid: %d) not owned by "
550 "requested user (uid: %d)\n", 550 "requested user (uid: %d)\n",
551 path.dentry->d_inode->i_uid, current_uid()); 551 i_uid_read(path.dentry->d_inode),
552 from_kuid(&init_user_ns, current_uid()));
552 goto out_free; 553 goto out_free;
553 } 554 }
554 555
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c
index b29bb8bfa8d..5fa2471796c 100644
--- a/fs/ecryptfs/messaging.c
+++ b/fs/ecryptfs/messaging.c
@@ -33,7 +33,7 @@ static struct hlist_head *ecryptfs_daemon_hash;
33struct mutex ecryptfs_daemon_hash_mux; 33struct mutex ecryptfs_daemon_hash_mux;
34static int ecryptfs_hash_bits; 34static int ecryptfs_hash_bits;
35#define ecryptfs_current_euid_hash(uid) \ 35#define ecryptfs_current_euid_hash(uid) \
36 hash_long((unsigned long)current_euid(), ecryptfs_hash_bits) 36 hash_long((unsigned long)from_kuid(&init_user_ns, current_euid()), ecryptfs_hash_bits)
37 37
38static u32 ecryptfs_msg_counter; 38static u32 ecryptfs_msg_counter;
39static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr; 39static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;
@@ -121,8 +121,7 @@ int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon)
121 hlist_for_each_entry(*daemon, elem, 121 hlist_for_each_entry(*daemon, elem,
122 &ecryptfs_daemon_hash[ecryptfs_current_euid_hash()], 122 &ecryptfs_daemon_hash[ecryptfs_current_euid_hash()],
123 euid_chain) { 123 euid_chain) {
124 if ((*daemon)->file->f_cred->euid == current_euid() && 124 if (uid_eq((*daemon)->file->f_cred->euid, current_euid())) {
125 (*daemon)->file->f_cred->user_ns == current_user_ns()) {
126 rc = 0; 125 rc = 0;
127 goto out; 126 goto out;
128 } 127 }
diff --git a/init/Kconfig b/init/Kconfig
index 5f846b57a75..6120bae29ae 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -941,7 +941,6 @@ config UIDGID_CONVERTED
941 depends on CEPH_FS = n 941 depends on CEPH_FS = n
942 depends on CIFS = n 942 depends on CIFS = n
943 depends on CODA_FS = n 943 depends on CODA_FS = n
944 depends on ECRYPT_FS = n
945 depends on EFS_FS = n 944 depends on EFS_FS = n
946 depends on EXOFS_FS = n 945 depends on EXOFS_FS = n
947 depends on FUSE_FS = n 946 depends on FUSE_FS = n