mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
SUNRPC: Cache the process user cred in the RPC server listener
In order to be able to interpret uids and gids correctly in knfsd, we should cache the user namespace of the process that created the RPC server's listener. To do so, we refcount the credential of that process. Signed-off-by: Trond Myklebust <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
This commit is contained in:
parent
e333f3bbef
commit
4df493a260
9 changed files with 39 additions and 26 deletions
|
|
@ -190,12 +190,13 @@ static int create_lockd_listener(struct svc_serv *serv, const char *name,
|
|||
struct net *net, const int family,
|
||||
const unsigned short port)
|
||||
{
|
||||
const struct cred *cred = current_cred();
|
||||
struct svc_xprt *xprt;
|
||||
|
||||
xprt = svc_find_xprt(serv, name, net, family, 0);
|
||||
if (xprt == NULL)
|
||||
return svc_create_xprt(serv, name, net, family, port,
|
||||
SVC_SOCK_DEFAULTS);
|
||||
SVC_SOCK_DEFAULTS, cred);
|
||||
svc_xprt_put(xprt);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue