aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@aristanetworks.com>2011-08-11 23:27:53 -0500
committerEric W. Biederman <ebiederm@aristanetworks.com>2011-08-11 23:27:53 -0500
commit39ced86b75071d86fbf3da04c3acad075526ff20 (patch)
tree6ea52afa88876fd0906c54d4586d5a58c5d56432
parentdc2db4f10e37591ca66ee13f567fe76e72fdf720 (diff)
downloadlinux-user-ns-devel-39ced86b75071d86fbf3da04c3acad075526ff20.tar.gz
ext4: Don't create inodes for users we can't represent on disk.
-rw-r--r--fs/ext4/ialloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 9c63f273b55049..56e976b302e047 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -825,6 +825,9 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode,
return ERR_PTR(-EPERM);
sb = dir->i_sb;
+ if (sb->s_user_ns != current_user_ns())
+ return ERR_PTR(-EPERM);
+
ngroups = ext4_get_groups_count(sb);
trace_ext4_request_inode(dir, mode);
inode = new_inode(sb);