linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] SUNRPC: Fix a client regression when handling oversized replies
@ 2019-03-15 17:51 Trond Myklebust
  2019-03-15 17:51 ` [PATCH 2/6] SUNRPC: Fix the minimal size for reply buffer allocation Trond Myklebust
  0 siblings, 1 reply; 6+ messages in thread
From: Trond Myklebust @ 2019-03-15 17:51 UTC (permalink / raw)
  To: linux-nfs

If the server sends a reply that is larger than the pre-allocated
buffer, then the current code may fail to register how much of
the stream that it has finished reading. This again can lead to
hangs.

Fixes: e92053a52e68 ("SUNRPC: Handle zero length fragments correctly")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 net/sunrpc/xprtsock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 42f45d33dc56..9359539907ba 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -453,7 +453,7 @@ xs_read_xdr_buf(struct socket *sock, struct msghdr *msg, int flags,
 			goto out;
 		if (ret != want)
 			goto out;
-	} else
+	} else if (offset < seek_init)
 		offset = seek_init;
 	ret = -EMSGSIZE;
 out:
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-03-15 17:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-15 17:51 [PATCH 1/6] SUNRPC: Fix a client regression when handling oversized replies Trond Myklebust
2019-03-15 17:51 ` [PATCH 2/6] SUNRPC: Fix the minimal size for reply buffer allocation Trond Myklebust
2019-03-15 17:51   ` [PATCH 3/6] SUNRPC: Use the ENOTCONN error on socket disconnect Trond Myklebust
2019-03-15 17:51     ` [PATCH 4/6] SUNRPC: rpc_decode_header() must always return a non-zero value on error Trond Myklebust
2019-03-15 17:51       ` [PATCH 5/6] SUNRPC: Handle the SYSTEM_ERR rpc error Trond Myklebust
2019-03-15 17:51         ` [PATCH 6/6] SUNRPC: Remove redundant check for the reply length in call_decode() Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).