diff options
Diffstat (limited to 'fs/ecryptfs/main.c')
| -rw-r--r-- | fs/ecryptfs/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 9b627c15010a..4e0886c9e5c4 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
| @@ -545,11 +545,12 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags | |||
| 545 | goto out_free; | 545 | goto out_free; |
| 546 | } | 546 | } |
| 547 | 547 | ||
| 548 | if (check_ruid && path.dentry->d_inode->i_uid != current_uid()) { | 548 | if (check_ruid && !uid_eq(path.dentry->d_inode->i_uid, current_uid())) { |
| 549 | rc = -EPERM; | 549 | rc = -EPERM; |
| 550 | printk(KERN_ERR "Mount of device (uid: %d) not owned by " | 550 | printk(KERN_ERR "Mount of device (uid: %d) not owned by " |
| 551 | "requested user (uid: %d)\n", | 551 | "requested user (uid: %d)\n", |
| 552 | path.dentry->d_inode->i_uid, current_uid()); | 552 | i_uid_read(path.dentry->d_inode), |
| 553 | from_kuid(&init_user_ns, current_uid())); | ||
| 553 | goto out_free; | 554 | goto out_free; |
| 554 | } | 555 | } |
| 555 | 556 | ||
| @@ -710,6 +711,12 @@ static void ecryptfs_free_kmem_caches(void) | |||
| 710 | { | 711 | { |
| 711 | int i; | 712 | int i; |
| 712 | 713 | ||
| 714 | /* | ||
| 715 | * Make sure all delayed rcu free inodes are flushed before we | ||
| 716 | * destroy cache. | ||
| 717 | */ | ||
| 718 | rcu_barrier(); | ||
| 719 | |||
| 713 | for (i = 0; i < ARRAY_SIZE(ecryptfs_cache_infos); i++) { | 720 | for (i = 0; i < ARRAY_SIZE(ecryptfs_cache_infos); i++) { |
| 714 | struct ecryptfs_cache_info *info; | 721 | struct ecryptfs_cache_info *info; |
| 715 | 722 | ||
