From patchwork Wed Aug 21 18:33:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dwight Engen X-Patchwork-Id: 268889 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id DA2B82C016F for ; Thu, 22 Aug 2013 04:37:10 +1000 (EST) X-Greylist: delayed 95326 seconds by postgrey-1.34 at bilbo; Thu, 22 Aug 2013 04:36:28 EST Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "userp1040.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 0ADBF2C00C8; Thu, 22 Aug 2013 04:36:27 +1000 (EST) Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7LIY0J4014381 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 21 Aug 2013 18:34:00 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7LIXuoD017952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Aug 2013 18:33:57 GMT Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7LIXumK012067; Wed, 21 Aug 2013 18:33:56 GMT Received: from localhost.localdomain (/71.171.120.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 21 Aug 2013 11:33:56 -0700 Date: Wed, 21 Aug 2013 14:33:51 -0400 From: Dwight Engen To: Ben Myers Subject: [PATCH] powerpc/spufs: convert userns uid/gid mount options to kuid/kgid Message-ID: <20130821143351.5840d556@oracle.com> In-Reply-To: <20130821155654.GI5262@sgi.com> References: <20130820172052.1f0d89ddf6a1a40ef70333fd@canb.auug.org.au> <20130820120702.000b044e@oracle.com> <201308202246.30869.arnd@arndb.de> <20130821010822.220f592a@oracle.com> <52145E6C.80404@ozlabs.org> <20130821155654.GI5262@sgi.com> Organization: Oracle Corporation Mime-Version: 1.0 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Cc: cbe-oss-dev@lists.ozlabs.org, Stephen Rothwell , Arnd Bergmann , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, linux-next@vger.kernel.org, Jeremy Kerr , linuxppc-dev@lists.ozlabs.org, Gao feng X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16rc2 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Acked-by: Jeremy Kerr Tested-by: Jeremy Kerr Signed-off-by: Dwight Engen Reviewed-by: Arnd Bergmann --- arch/powerpc/platforms/cell/spufs/inode.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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))