linux-uconsole/include/linux/sunrpc
Stanislav Kinsbursky 344f3a6bce nfsd: check passed socket's net matches NFSd superblock's one
commit 3064639423 upstream.

There could be a case, when NFSd file system is mounted in network, different
to socket's one, like below:

"ip netns exec" creates new network and mount namespace, which duplicates NFSd
mount point, created in init_net context. And thus NFS server stop in nested
network context leads to RPCBIND client destruction in init_net.
Then, on NFSd start in nested network context, rpc.nfsd process creates socket
in nested net and passes it into "write_ports", which leads to RPCBIND sockets
creation in init_net context because of the same reason (NFSd monut point was
created in init_net context). An attempt to register passed socket in nested
net leads to panic, because no RPCBIND client present in nexted network
namespace.

This patch add check that passed socket's net matches NFSd superblock's one.
And returns -EINVAL error to user psace otherwise.

v2: Put socket on exit.

Reported-by: Weng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-06 07:55:29 -07:00
..
addr.h sunrpc: move address copy/cmp/convert routines and prototypes from clnt.h to addr.h 2013-02-05 09:41:14 -05:00
auth.h SUNRPC: Refactor nfsd4_do_encode_secinfo() 2013-03-29 15:43:33 -04:00
auth_gss.h
bc_xprt.h
cache.h SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function 2013-02-15 10:43:47 -05:00
clnt.h SUNRPC: allow disabling idle timeout 2013-04-26 11:41:26 -04:00
debug.h UAPI: (Scripted) Disintegrate include/linux/sunrpc 2012-10-09 09:49:04 +01:00
gss_api.h Merge branch 'nfs-for-next' of git://linux-nfs.org/~trondmy/nfs-2.6 into for-3.10 2013-04-29 16:23:34 -04:00
gss_asn1.h
gss_err.h
gss_krb5.h
gss_krb5_enctypes.h
metrics.h
msg_prot.h nfsd4: check backchannel attributes on create_session 2013-04-09 16:53:56 -04:00
rpc_pipe_fs.h
rpc_rdma.h
sched.h SUNRPC: If the rpcbind channel is disconnected, fail the call to unregister 2013-08-14 22:59:08 -07:00
stats.h
svc.h sunrpc: Fix lockd sleeping until timeout 2013-01-23 18:17:39 -05:00
svc_rdma.h
svc_xprt.h
svcauth.h sunrpc: Use kuid_t and kgid_t where appropriate 2013-02-13 06:15:16 -08:00
svcauth_gss.h
svcsock.h nfsd: check passed socket's net matches NFSd superblock's one 2014-05-06 07:55:29 -07:00
timer.h
types.h
xdr.h sunrpc: trim off trailing checksum before returning decrypted or integrity authenticated buffer 2013-02-08 15:19:10 -05:00
xprt.h SUNRPC: allow disabling idle timeout 2013-04-26 11:41:26 -04:00
xprtrdma.h
xprtsock.h