linux-hardened/include/linux/sunrpc
Chuck Lever ba9b584c1d SUNRPC: Introduce rpc_clone_client_set_auth()
An ULP is supposed to be able to replace a GSS rpc_auth object with
another GSS rpc_auth object using rpcauth_create().  However,
rpcauth_create() in 3.5 reliably fails with -EEXIST in this case.
This is because when gss_create() attempts to create the upcall pipes,
sometimes they are already there.  For example if a pipe FS mount
event occurs, or a previous GSS flavor was in use for this rpc_clnt.

It turns out that's not the only problem here.  While working on a
fix for the above problem, we noticed that replacing an rpc_clnt's
rpc_auth is not safe, since dereferencing the cl_auth field is not
protected in any way.

So we're deprecating the ability of rpcauth_create() to switch an
rpc_clnt's security flavor during normal operation.  Instead, let's
add a fresh API that clones an rpc_clnt and gives the clone a new
flavor before it's used.

This makes immediate use of the new __rpc_clone_client() helper.

This can be used in a similar fashion to rpcauth_create() when a
client is hunting for the correct security flavor.  Instead of
replacing an rpc_clnt's security flavor in a loop, the ULP replaces
the whole rpc_clnt.

To fix the -EEXIST problem, any ULP logic that relies on replacing
an rpc_clnt's rpc_auth with rpcauth_create() must be changed to use
this API instead.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-10-01 15:33:33 -07:00
..
auth.h SUNRPC: Add rpcauth_list_flavors() 2012-07-16 15:12:15 -04:00
auth_gss.h SUNRPC: Clean up the RPCSEC_GSS service ticket requests 2012-01-05 10:42:38 -05:00
bc_xprt.h SUNRPC: Fix a few sparse warnings 2012-03-11 19:30:02 -04:00
cache.h nfsd: add get_uint for u32's 2012-07-25 09:18:27 -04:00
clnt.h SUNRPC: Introduce rpc_clone_client_set_auth() 2012-10-01 15:33:33 -07:00
debug.h SUNRPC: Kill compiler warning when RPC_DEBUG is unset 2012-03-21 09:31:31 -04:00
gss_api.h SUNRPC: Add rpcauth_list_flavors() 2012-07-16 15:12:15 -04:00
gss_asn1.h
gss_err.h
gss_krb5.h
gss_krb5_enctypes.h nfsd: fix dependency of nfsd on auth_rpcgss 2011-06-06 15:07:15 -04:00
Kbuild
metrics.h NFS: include filelayout DS rpc stats in mountstats 2012-02-17 13:39:47 -05:00
msg_prot.h
rpc_pipe_fs.h SUNRPC: move waitq from RPC pipe to RPC inode 2012-02-27 13:37:48 -05:00
rpc_rdma.h
sched.h NFS: include filelayout DS rpc stats in mountstats 2012-02-17 13:39:47 -05:00
stats.h SUNRPC: constify the rpc_program 2012-01-31 19:28:20 -05:00
svc.h SUNRPC: service request network namespace helper introduced 2012-07-27 16:49:21 -04:00
svc_rdma.h svcrdma: silence a Sparse warning 2012-03-06 18:13:33 -05:00
svc_xprt.h SUNRPC: search for service transports in network namespace context 2012-01-31 19:28:19 -05:00
svcauth.h nfsd4: move rq_flavor into svc_cred 2012-05-31 20:29:58 -04:00
svcauth_gss.h nfsd4: move principal name into svc_cred 2012-05-31 20:29:55 -04:00
svcsock.h SUNRPC: service destruction in network namespace context 2012-02-15 00:19:45 -05:00
timer.h atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
types.h
xdr.h SUNRPC: Remove unused function xdr_encode_pages 2012-06-28 17:20:49 -04:00
xprt.h SUNRPC: Get rid of the redundant xprt->shutdown bit field 2012-09-28 16:03:05 -04:00
xprtrdma.h
xprtsock.h SUNRPC: Fix a few sparse warnings 2012-03-11 19:30:02 -04:00