summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-05-17 08:50:11 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-05-20 12:17:08 -0400
commitd275880abce9ac66cb842af828fbc2b1ba8082a0 (patch)
tree26e64b5b8e7d7f5cc8623fb8911e94090d04f895 /net/sunrpc
parenta421d218603ffa822a0b8045055c03eae394a7eb (diff)
downloadlinux-stable-d275880abce9ac66cb842af828fbc2b1ba8082a0.tar.gz
linux-stable-d275880abce9ac66cb842af828fbc2b1ba8082a0.tar.bz2
linux-stable-d275880abce9ac66cb842af828fbc2b1ba8082a0.zip
SUNRPC: Fix Oops in xs_tcp_send_request() when transport is disconnected
If a disconnection occurs while we're trying to reply to a server callback, then we may end up calling xs_tcp_send_request() with a NULL value for transport->inet, which trips up the call to tcp_sock_set_cork(). Fixes: d737e5d41870 ("SUNRPC: Set TCP_CORK until the transmit queue is empty") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtsock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 47aa47a2b07c..316d04945587 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1010,6 +1010,8 @@ static int xs_tcp_send_request(struct rpc_rqst *req)
kernel_sock_shutdown(transport->sock, SHUT_RDWR);
return -ENOTCONN;
}
+ if (!transport->inet)
+ return -ENOTCONN;
xs_pktdump("packet data:",
req->rq_svec->iov_base,