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 <trond.myklebust@hammerspace.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:

committed by
J. Bruce Fields

parent
e333f3bbef
commit
4df493a260
@@ -86,6 +86,7 @@ struct svc_xprt {
|
||||
struct list_head xpt_users; /* callbacks on free */
|
||||
|
||||
struct net *xpt_net;
|
||||
const struct cred *xpt_cred;
|
||||
struct rpc_xprt *xpt_bc_xprt; /* NFSv4.1 backchannel */
|
||||
struct rpc_xprt_switch *xpt_bc_xps; /* NFSv4.1 backchannel */
|
||||
};
|
||||
@@ -119,7 +120,8 @@ void svc_unreg_xprt_class(struct svc_xprt_class *);
|
||||
void svc_xprt_init(struct net *, struct svc_xprt_class *, struct svc_xprt *,
|
||||
struct svc_serv *);
|
||||
int svc_create_xprt(struct svc_serv *, const char *, struct net *,
|
||||
const int, const unsigned short, int);
|
||||
const int, const unsigned short, int,
|
||||
const struct cred *);
|
||||
void svc_xprt_do_enqueue(struct svc_xprt *xprt);
|
||||
void svc_xprt_enqueue(struct svc_xprt *xprt);
|
||||
void svc_xprt_put(struct svc_xprt *xprt);
|
||||
|
@@ -59,7 +59,8 @@ void svc_drop(struct svc_rqst *);
|
||||
void svc_sock_update_bufs(struct svc_serv *serv);
|
||||
bool svc_alien_sock(struct net *net, int fd);
|
||||
int svc_addsock(struct svc_serv *serv, const int fd,
|
||||
char *name_return, const size_t len);
|
||||
char *name_return, const size_t len,
|
||||
const struct cred *cred);
|
||||
void svc_init_xprt_sock(void);
|
||||
void svc_cleanup_xprt_sock(void);
|
||||
struct svc_xprt *svc_sock_create(struct svc_serv *serv, int prot);
|
||||
|
Reference in New Issue
Block a user