diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2021-03-22 14:37:01 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2021-04-05 09:04:21 -0400 |
commit | 98b5cee37389b899de044bc4aac56e6ff33dbd4d (patch) | |
tree | 04fa110730aa200b030fd6651e4fd1ec0f22d3bf /net | |
parent | c9301cb35b59ad7d733a7332f3aefd4da1382468 (diff) | |
download | linux-stable-98b5cee37389b899de044bc4aac56e6ff33dbd4d.tar.gz linux-stable-98b5cee37389b899de044bc4aac56e6ff33dbd4d.tar.bz2 linux-stable-98b5cee37389b899de044bc4aac56e6ff33dbd4d.zip |
SUNRPC: Ensure the transport backchannel association
If the server sends CB_ calls on a connection that is not associated
with the backchannel, refuse to process the call and shut down the
connection. This avoids a NULL dereference crash in
xprt_complete_bc_request(). There's not much more we can do in this
situation unless we want to look into allowing all connections to be
associated with the fore and back channel.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprtsock.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index a64f5ed1edb4..47aa47a2b07c 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -558,6 +558,10 @@ xs_read_stream_call(struct sock_xprt *transport, struct msghdr *msg, int flags) struct rpc_rqst *req; ssize_t ret; + /* Is this transport associated with the backchannel? */ + if (!xprt->bc_serv) + return -ESHUTDOWN; + /* Look up and lock the request corresponding to the given XID */ req = xprt_lookup_bc_request(xprt, transport->recv.xid); if (!req) { |