Skip to content

Commit

Permalink
mptcp: update rtx timeout only if required.
Browse files Browse the repository at this point in the history
We must start the retransmission timer only there are
pending data in the rtx queue.
Otherwise we can hit a WARN_ON in mptcp_reset_timer(),
as syzbot demonstrated.

Reported-and-tested-by: [email protected]
Fixes: d9ca1de ("mptcp: move page frag allocation in mptcp_sendmsg()")
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
Paolo Abeni authored and jenkins-tessares committed Nov 19, 2020
1 parent e76d795 commit c3c899e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,11 +1261,12 @@ static void mptcp_push_pending(struct sock *sk, unsigned int flags)
mptcp_push_release(sk, ssk, &info);

out:
/* start the timer, if it's not pending */
if (!mptcp_timer_pending(sk))
mptcp_reset_timer(sk);
if (copied)
if (copied) {
/* start the timer, if it's not pending */
if (!mptcp_timer_pending(sk))
mptcp_reset_timer(sk);
__mptcp_check_send_data_fin(sk);
}
}

static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
Expand Down

0 comments on commit c3c899e

Please sign in to comment.