mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
svcrpc: fix BUG() in svc_tcp_clear_pages
commit be1e44441a
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cbd3df71bb
commit
389aec3383
1 changed files with 1 additions and 1 deletions
|
@ -1137,9 +1137,9 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
|
|||
if (len >= 0)
|
||||
svsk->sk_tcplen += len;
|
||||
if (len != want) {
|
||||
svc_tcp_save_pages(svsk, rqstp);
|
||||
if (len < 0 && len != -EAGAIN)
|
||||
goto err_other;
|
||||
svc_tcp_save_pages(svsk, rqstp);
|
||||
dprintk("svc: incomplete TCP record (%d of %d)\n",
|
||||
svsk->sk_tcplen, svsk->sk_reclen);
|
||||
goto err_noclose;
|
||||
|
|
Loading…
Reference in a new issue