svcrpc: fix handling of too-short rpc's
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 26 Jun 2013 15:09:06 +0000 (11:09 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2013 21:07:31 +0000 (14:07 -0700)
commit57370589c166cc8747f5e09365407d9dc04d7425
tree2b938480284ef58661701005613770b0604d4bff
parentc814208bb3542333629cc3c9e79666e94425899a
svcrpc: fix handling of too-short rpc's

commit cf3aa02cb4a0c5af5557dd47f15a08a7df33182a upstream.

If we detect that an rpc is too short, we abort and close the
connection.  Except, there's a bug here: we're leaving sk_datalen
nonzero without leaving any pages in the sk_pages array.  The most
likely result of the inconsistency is a subsequent crash in
svc_tcp_clear_pages.

Also demote the BUG_ON in svc_tcp_clear_pages to a WARN.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/svcsock.c