Fix: Take mpcb-mutex when acting upon address-event

We must do this, in order to prevent entering the address-worker while
inside mptcp_close.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Reconstruct skb-mapping, if reinjection failed

mptcp_skb_entail changed seq and end_seq to a subflow-level. If the
reinjection thus fails, mptcp_transmit_skb_failed will put it back on
the reinject-queue.

We have to recover the mapping out of the linear TCP-header.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Remove pointers to socket from subflows upon mptcp_close

Otherwise we will be accessing garbage from the subsockets, as socket will be freed after
the mptcp_close.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: triple-lock error when sending reset from mptcp_do_join_short

We may have the following path:
tcp_v4_do_rcv->mptcp_do_join_short->mptcp_v4_do_rcv->tcp_v4_send_reset.

ip_send_reply (from tcp_v4_send_reset) will try to take the lock on the
socket. However, we are already holding two locks. The listener and the
meta. Lockdep will complain here.

So, we propagate the reset-sending up to tcp_rcv_state_process.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Set the correct lock-class for ALL subflows

Subsockets created on the client-side also needs the correct lock class.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: mptcp_retransmit_timer

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Only send reset if necessary

Because, the socket may not be correctly initialized (e.g.,
mptcp_init4_subsockets failed). Then, rcv_mss is 0, and
__mptcp_select_window will fail with a 0 divide (called from
tcp_transmit_skb).

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Always force-close subflows on tcp_disconnect

Because, afterwards meta_tp->window_clamp will be set to 0. Then, when
we retransmit our MP_FAIL, the socket will select a zero mss in
__mptcp_select_window. This will result in a crash if window-scaling is
turned off.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Hold the subsocket lock in tcp_disconnect

Because, we set mpc to 0, which will mean that tcp_v4_rcv will take the
subsocket's lock. Then we may have a race.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>