]> git.karo-electronics.de Git - karo-tx-linux.git/commit
svcrpc: fix BUG() in svc_tcp_clear_pages
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 9 Aug 2012 22:12:28 +0000 (18:12 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 12 Sep 2012 02:37:22 +0000 (03:37 +0100)
commitb4d810559cd5e73751adbd9cf05034bb8775a691
tree4b93a583d655dffd8585430e2ae8d4d0f6bc38f1
parent6e6abc0339f25e0f45d85fec27aef1e8fe358897
svcrpc: fix BUG() in svc_tcp_clear_pages

commit be1e44441a560c43c136a562d49a1c9623c91197 upstream.

Examination of svc_tcp_clear_pages shows that it assumes sk_tcplen is
consistent with sk_pages[] (in particular, sk_pages[n] can't be NULL if
sk_tcplen would lead us to expect n pages of data).

svc_tcp_restore_pages zeroes out sk_pages[] while leaving sk_tcplen.
This is OK, since both functions are serialized by XPT_BUSY.  However,
that means the inconsistency must be repaired before dropping XPT_BUSY.

Therefore we should be ensuring that svc_tcp_save_pages repairs the
problem before exiting svc_tcp_recv_record on error.

Symptoms were a BUG() in svc_tcp_clear_pages.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/sunrpc/svcsock.c