linux-stable/net/sunrpc
Eric W. Biederman 25da926371 sunrpc: Properly encode kuids and kgids in auth.unix.gid rpc pipe upcalls.
When a new rpc connection is established with an in-kernel server, the
traffic passes through svc_process_common, and svc_set_client and down
into svcauth_unix_set_client if it is of type RPC_AUTH_NULL or
RPC_AUTH_UNIX.

svcauth_unix_set_client then looks at the uid of the credential we
have assigned to the incomming client and if we don't have the groups
already cached makes an upcall to get a list of groups that the client
can use.

The upcall encodes send a rpc message to user space encoding the uid
of the user whose groups we want to know.  Encode the kuid of the user
in the initial user namespace as nfs mounts can only happen today in
the initial user namespace.

When a reply to an upcall comes in convert interpret the uid and gid values
from the rpc pipe as uids and gids in the initial user namespace and convert
them into kuids and kgids before processing them further.

When reading proc files listing the uid to gid list cache convert the
kuids and kgids from into uids and gids the initial user namespace.  As we are
displaying server internal details it makes sense to display these values
from the servers perspective.

Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2013-02-13 06:15:25 -08:00
..
auth_gss sunrpc: Update svcgss xdr handle to rpsec_contect cache 2013-02-13 06:15:22 -08:00
xprtrdma nfsd4: cleanup: replace rq_resused count by rq_next_page pointer 2012-12-17 22:00:16 -05:00
addr.c SUNRPC: parametrize rpc_uaddr2sockaddr() by network context 2012-01-31 19:28:12 -05:00
auth.c sunrpc: Hash uids by first computing their value in the initial userns 2013-02-13 06:15:23 -08:00
auth_generic.c sunrpc: Convert kuids and kgids to uids and gids for printing 2013-02-13 06:15:19 -08:00
auth_null.c SUNRPC: Move the bound cred to struct rpc_rqst 2010-08-04 08:54:09 -04:00
auth_unix.c sunrpc: Properly encode kuids and kgids in RPC_AUTH_UNIX credentials 2013-02-13 06:15:24 -08:00
backchannel_rqst.c SUNRPC: remove two BUG_ON asserts 2012-11-04 14:43:41 -05:00
bc_svc.c SUNRPC: remove BUG_ON from bc_send 2012-11-04 14:43:41 -05:00
cache.c SUNRPC: remove BUG_ON calls from cache_read 2012-11-04 14:43:41 -05:00
clnt.c SUNRPC: continue run over clients list on PipeFS event instead of break 2012-12-17 12:19:16 -05:00
Kconfig nfs: enable swap on NFS 2012-07-31 18:42:48 -07:00
Makefile SUNRPC: sunrpc should not explicitly depend on NFS config options 2011-07-15 09:12:23 -04:00
netns.h SUNRPC: create GSS auth cache per network namespace 2012-01-31 19:28:15 -05:00
rpc_pipe.c Merge branch 'bugfixes' into nfs-for-next 2012-12-11 09:16:26 -05:00
rpcb_clnt.c Merge branch 'for-3.8' of git://linux-nfs.org/~bfields/linux 2012-12-20 14:04:11 -08:00
sched.c SUNRPC: Don't allow low priority tasks to pre-empt higher priority ones 2012-12-06 00:30:53 +01:00
socklib.c sunrpc: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:28 +08:00
stats.c SUNRPC: Use RCU to dereference the rpc_clnt.cl_xprt field 2012-03-02 15:36:38 -05:00
sunrpc.h SUNRPC: subscribe RPC clients to pipefs notifications 2012-01-31 18:20:25 -05:00
sunrpc_syms.c SUNRPC: register PipeFS file system after pernet sybsystem 2012-04-18 11:05:48 -04:00
svc.c Merge branch 'for-3.8' of git://linux-nfs.org/~bfields/linux 2012-12-20 14:04:11 -08:00
svc_xprt.c SUNRPC: remove BUG_ON in svc_delete_xprt 2012-11-04 14:43:42 -05:00
svcauth.c net: sunrpc: kill unused macros 2010-12-17 15:48:21 -05:00
svcauth_unix.c sunrpc: Properly encode kuids and kgids in auth.unix.gid rpc pipe upcalls. 2013-02-13 06:15:25 -08:00
svcsock.c Merge branch 'for-3.8' of git://linux-nfs.org/~bfields/linux 2012-12-20 14:04:11 -08:00
sysctl.c SUNRPC: make SUNPRC clients list per network namespace context 2012-01-31 18:20:25 -05:00
timer.c net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
xdr.c SUNRPC: remove BUG_ON in xdr_shrink_bufhead 2012-11-04 14:43:42 -05:00
xprt.c SUNRPC: Get rid of the redundant xprt->shutdown bit field 2012-09-28 16:03:05 -04:00
xprtsock.c SUNRPC: variable 'svsk' is unused in function bc_send_request 2012-12-15 17:05:57 -05:00