Commit 369cf4be authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Greg Kroah-Hartman

svcrpc: don't error out on small tcp fragment

commit 1f691b07 upstream.

Though clients we care about mostly don't do this, it is possible for
rpc requests to be sent in multiple fragments.  Here we have a sanity
check to ensure that the final received rpc isn't too small--except that
the number we're actually checking is the length of just the final
fragment, not of the whole rpc.  So a perfectly legal rpc that's
unluckily fragmented could cause the server to close the connection
here.
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 57370589
...@@ -1095,7 +1095,7 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) ...@@ -1095,7 +1095,7 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
goto err_noclose; goto err_noclose;
} }
if (svc_sock_reclen(svsk) < 8) { if (svsk->sk_datalen < 8) {
svsk->sk_datalen = 0; svsk->sk_datalen = 0;
goto err_delete; /* client is nuts. */ goto err_delete; /* client is nuts. */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment