Patchwork powerpc/spufs: convert userns uid/gid mount options to kuid/kgid

login
register
mail settings
Submitter Dwight Engen
Date Aug. 21, 2013, 6:33 p.m.
Message ID <20130821143351.5840d556@oracle.com>
Download mbox | patch
Permalink /patch/268889/
State Not Applicable
Headers show

Comments

Dwight Engen - Aug. 21, 2013, 6:33 p.m.
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Tested-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
---
 arch/powerpc/platforms/cell/spufs/inode.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
Arnd Bergmann - Aug. 21, 2013, 8:05 p.m.
On Wednesday 21 August 2013, Dwight Engen wrote:
> 
> Acked-by: Jeremy Kerr <jk@ozlabs.org>
> Tested-by: Jeremy Kerr <jk@ozlabs.org>
> Signed-off-by: Dwight Engen <dwight.engen@oracle.com>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Ben Myers - Aug. 21, 2013, 8:24 p.m.
On Wed, Aug 21, 2013 at 10:05:27PM +0200, Arnd Bergmann wrote:
> On Wednesday 21 August 2013, Dwight Engen wrote:
> > 
> > Acked-by: Jeremy Kerr <jk@ozlabs.org>
> > Tested-by: Jeremy Kerr <jk@ozlabs.org>
> > Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
> 
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>

Applied.

Thanks,
	-Ben

Patch

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))