Message ID | 20130821010822.220f592a@oracle.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Hi all, > Yes, I agree. The other filesystems that take an Opt_uid as well do use > current_user_ns() and not init_user_ns. They also do a uid_valid() > check and fail the mount (or fallback to GLOBAL_ROOT_UID). So I think > that would look like this: Looks good to me. Builds and mounts as expected. Acked-by: Jeremy Kerr <jk@ozlabs.org> Cheers, Jeremy
Hey Dwight, On Wed, Aug 21, 2013 at 02:30:04PM +0800, Jeremy Kerr wrote: > > Yes, I agree. The other filesystems that take an Opt_uid as well do use > > current_user_ns() and not init_user_ns. They also do a uid_valid() > > check and fail the mount (or fallback to GLOBAL_ROOT_UID). So I think > > that would look like this: > > Looks good to me. Builds and mounts as expected. > > Acked-by: Jeremy Kerr <jk@ozlabs.org> Could you repost this patch with the right subject and a commit header? Given Jeremy's Ack I think we could proceed to pull this in. Regards, Ben
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index f390042..87ba7cf 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -620,12 +620,16 @@ spufs_parse_options(struct super_block *sb, char *options, struct inode *root) case Opt_uid: if (match_int(&args[0], &option)) return 0; - root->i_uid = option; + root->i_uid = make_kuid(current_user_ns(), option); + if (!uid_valid(root->i_uid)) + return 0; break; case Opt_gid: if (match_int(&args[0], &option)) return 0; - root->i_gid = option; + root->i_gid = make_kgid(current_user_ns(), option); + if (!gid_valid(root->i_gid)) + return 0; break; case Opt_mode: if (match_octal(&args[0], &option))