From e58717819fb929d048eb3bf0764838cc2301fb14 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Tue, 7 Feb 2012 16:24:33 -0800 Subject: [PATCH] --- yaml --- r: 327283 b: refs/heads/master c: cdf8c58a3546443073cab77d07a88ee439319c19 h: refs/heads/master i: 327281: 8c72f400c51a2d67782e955a71ea529618474c1c 327279: 881f98ee1fd5e88d7a1b4453dedddc3204007ed8 v: v3 --- [refs] | 2 +- trunk/fs/ecryptfs/main.c | 5 +++-- trunk/fs/ecryptfs/messaging.c | 5 ++--- trunk/init/Kconfig | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index bb5d697779c9..0d05527f4519 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a7d9cfe97b450b27c82e6e41b2fde6214708560d +refs/heads/master: cdf8c58a3546443073cab77d07a88ee439319c19 diff --git a/trunk/fs/ecryptfs/main.c b/trunk/fs/ecryptfs/main.c index 2768138eefee..1d6ce91b7061 100644 --- a/trunk/fs/ecryptfs/main.c +++ b/trunk/fs/ecryptfs/main.c @@ -544,11 +544,12 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags goto out_free; } - if (check_ruid && path.dentry->d_inode->i_uid != current_uid()) { + if (check_ruid && !uid_eq(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()); + i_uid_read(path.dentry->d_inode), + from_kuid(&init_user_ns, current_uid())); goto out_free; } diff --git a/trunk/fs/ecryptfs/messaging.c b/trunk/fs/ecryptfs/messaging.c index b29bb8bfa8d9..5fa2471796c2 100644 --- a/trunk/fs/ecryptfs/messaging.c +++ b/trunk/fs/ecryptfs/messaging.c @@ -33,7 +33,7 @@ static struct hlist_head *ecryptfs_daemon_hash; struct mutex ecryptfs_daemon_hash_mux; static int ecryptfs_hash_bits; #define ecryptfs_current_euid_hash(uid) \ - hash_long((unsigned long)current_euid(), ecryptfs_hash_bits) + hash_long((unsigned long)from_kuid(&init_user_ns, current_euid()), ecryptfs_hash_bits) static u32 ecryptfs_msg_counter; static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr; @@ -121,8 +121,7 @@ int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon) hlist_for_each_entry(*daemon, elem, &ecryptfs_daemon_hash[ecryptfs_current_euid_hash()], euid_chain) { - if ((*daemon)->file->f_cred->euid == current_euid() && - (*daemon)->file->f_cred->user_ns == current_user_ns()) { + if (uid_eq((*daemon)->file->f_cred->euid, current_euid())) { rc = 0; goto out; } diff --git a/trunk/init/Kconfig b/trunk/init/Kconfig index 5f846b57a750..6120bae29aea 100644 --- a/trunk/init/Kconfig +++ b/trunk/init/Kconfig @@ -941,7 +941,6 @@ config UIDGID_CONVERTED depends on CEPH_FS = n depends on CIFS = n depends on CODA_FS = n - depends on ECRYPT_FS = n depends on EFS_FS = n depends on EXOFS_FS = n depends on FUSE_FS = n