Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

SUNRPC: Temporary sockets should inherit the cred from their parent

Temporary sockets should inherit the credential (and hence the user
namespace) from the parent listener transport.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Trond Myklebust and committed by
J. Bruce Fields
1237d354 4df493a2

+3 -2
+3 -2
net/sunrpc/svc_xprt.c
··· 786 786 __module_get(xprt->xpt_class->xcl_owner); 787 787 svc_check_conn_limits(xprt->xpt_server); 788 788 newxpt = xprt->xpt_ops->xpo_accept(xprt); 789 - if (newxpt) 789 + if (newxpt) { 790 + newxpt->xpt_cred = get_cred(xprt->xpt_cred); 790 791 svc_add_new_temp_xprt(serv, newxpt); 791 - else 792 + } else 792 793 module_put(xprt->xpt_class->xcl_owner); 793 794 } else if (svc_xprt_reserve_slot(rqstp, xprt)) { 794 795 /* XPT_DATA|XPT_DEFERRED case: */