Skip to content

Commit

Permalink
svcrpc: don't error out on small tcp fragment
Browse files Browse the repository at this point in the history
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.

Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
J. Bruce Fields committed Jul 1, 2013
1 parent cf3aa02 commit 1f691b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sunrpc/svcsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
goto err_noclose;
}

if (svc_sock_reclen(svsk) < 8) {
if (svsk->sk_datalen < 8) {
svsk->sk_datalen = 0;
goto err_delete; /* client is nuts. */
}
Expand Down

0 comments on commit 1f691b0

Please sign in to comment.