mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 11:33:28 +02:00
Merge branch 'mptcp-misc-fixes-involving-fallback-to-tcp'
Matthieu Baerts says: ==================== mptcp: misc. fixes involving fallback to TCP - Patch 1: better handle DSS corruptions from a bugged peer: reducing warnings, doing a fallback or a reset depending on the subflow state. For >= v5.7. - Patch 2: fix DSS corruption due to large pmtu xmit, where MPTCP was not taken into account. For >= v5.6. - Patch 3: fallback when MPTCP opts are dropped after the first data packet, instead of resetting the connection. For >= v5.6. - Patch 4: restrict the removal of a subflow to other closing states, a better fix, for a recent one. For >= v5.10. ==================== Link: https://patch.msgid.link/20241008-net-mptcp-fallback-fixes-v1-0-c6fb8e93e551@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
5151a35c9b
|
|
@ -2342,10 +2342,7 @@ static bool tcp_can_coalesce_send_queue_head(struct sock *sk, int len)
|
|||
if (len <= skb->len)
|
||||
break;
|
||||
|
||||
if (unlikely(TCP_SKB_CB(skb)->eor) ||
|
||||
tcp_has_tx_tstamp(skb) ||
|
||||
!skb_pure_zcopy_same(skb, next) ||
|
||||
skb_frags_readable(skb) != skb_frags_readable(next))
|
||||
if (tcp_has_tx_tstamp(skb) || !tcp_skb_can_collapse(skb, next))
|
||||
return false;
|
||||
|
||||
len -= skb->len;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ static const struct snmp_mib mptcp_snmp_list[] = {
|
|||
SNMP_MIB_ITEM("MPJoinSynTxBindErr", MPTCP_MIB_JOINSYNTXBINDERR),
|
||||
SNMP_MIB_ITEM("MPJoinSynTxConnectErr", MPTCP_MIB_JOINSYNTXCONNECTERR),
|
||||
SNMP_MIB_ITEM("DSSNotMatching", MPTCP_MIB_DSSNOMATCH),
|
||||
SNMP_MIB_ITEM("DSSCorruptionFallback", MPTCP_MIB_DSSCORRUPTIONFALLBACK),
|
||||
SNMP_MIB_ITEM("DSSCorruptionReset", MPTCP_MIB_DSSCORRUPTIONRESET),
|
||||
SNMP_MIB_ITEM("InfiniteMapTx", MPTCP_MIB_INFINITEMAPTX),
|
||||
SNMP_MIB_ITEM("InfiniteMapRx", MPTCP_MIB_INFINITEMAPRX),
|
||||
SNMP_MIB_ITEM("DSSNoMatchTCP", MPTCP_MIB_DSSTCPMISMATCH),
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ enum linux_mptcp_mib_field {
|
|||
MPTCP_MIB_JOINSYNTXBINDERR, /* Not able to bind() the address when sending a SYN + MP_JOIN */
|
||||
MPTCP_MIB_JOINSYNTXCONNECTERR, /* Not able to connect() when sending a SYN + MP_JOIN */
|
||||
MPTCP_MIB_DSSNOMATCH, /* Received a new mapping that did not match the previous one */
|
||||
MPTCP_MIB_DSSCORRUPTIONFALLBACK,/* DSS corruption detected, fallback */
|
||||
MPTCP_MIB_DSSCORRUPTIONRESET, /* DSS corruption detected, MPJ subflow reset */
|
||||
MPTCP_MIB_INFINITEMAPTX, /* Sent an infinite mapping */
|
||||
MPTCP_MIB_INFINITEMAPRX, /* Received an infinite mapping */
|
||||
MPTCP_MIB_DSSTCPMISMATCH, /* DSS-mapping did not map with TCP's sequence numbers */
|
||||
|
|
|
|||
|
|
@ -860,7 +860,8 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,
|
|||
int how = RCV_SHUTDOWN | SEND_SHUTDOWN;
|
||||
u8 id = subflow_get_local_id(subflow);
|
||||
|
||||
if (inet_sk_state_load(ssk) == TCP_CLOSE)
|
||||
if ((1 << inet_sk_state_load(ssk)) &
|
||||
(TCPF_FIN_WAIT1 | TCPF_FIN_WAIT2 | TCPF_CLOSING | TCPF_CLOSE))
|
||||
continue;
|
||||
if (rm_type == MPTCP_MIB_RMADDR && remote_id != rm_id)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -620,6 +620,18 @@ static bool mptcp_check_data_fin(struct sock *sk)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void mptcp_dss_corruption(struct mptcp_sock *msk, struct sock *ssk)
|
||||
{
|
||||
if (READ_ONCE(msk->allow_infinite_fallback)) {
|
||||
MPTCP_INC_STATS(sock_net(ssk),
|
||||
MPTCP_MIB_DSSCORRUPTIONFALLBACK);
|
||||
mptcp_do_fallback(ssk);
|
||||
} else {
|
||||
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DSSCORRUPTIONRESET);
|
||||
mptcp_subflow_reset(ssk);
|
||||
}
|
||||
}
|
||||
|
||||
static bool __mptcp_move_skbs_from_subflow(struct mptcp_sock *msk,
|
||||
struct sock *ssk,
|
||||
unsigned int *bytes)
|
||||
|
|
@ -692,10 +704,16 @@ static bool __mptcp_move_skbs_from_subflow(struct mptcp_sock *msk,
|
|||
moved += len;
|
||||
seq += len;
|
||||
|
||||
if (WARN_ON_ONCE(map_remaining < len))
|
||||
break;
|
||||
if (unlikely(map_remaining < len)) {
|
||||
DEBUG_NET_WARN_ON_ONCE(1);
|
||||
mptcp_dss_corruption(msk, ssk);
|
||||
}
|
||||
} else {
|
||||
WARN_ON_ONCE(!fin);
|
||||
if (unlikely(!fin)) {
|
||||
DEBUG_NET_WARN_ON_ONCE(1);
|
||||
mptcp_dss_corruption(msk, ssk);
|
||||
}
|
||||
|
||||
sk_eat_skb(ssk, skb);
|
||||
done = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -975,8 +975,10 @@ static bool skb_is_fully_mapped(struct sock *ssk, struct sk_buff *skb)
|
|||
unsigned int skb_consumed;
|
||||
|
||||
skb_consumed = tcp_sk(ssk)->copied_seq - TCP_SKB_CB(skb)->seq;
|
||||
if (WARN_ON_ONCE(skb_consumed >= skb->len))
|
||||
if (unlikely(skb_consumed >= skb->len)) {
|
||||
DEBUG_NET_WARN_ON_ONCE(1);
|
||||
return true;
|
||||
}
|
||||
|
||||
return skb->len - skb_consumed <= subflow->map_data_len -
|
||||
mptcp_subflow_get_map_offset(subflow);
|
||||
|
|
@ -1280,7 +1282,7 @@ static bool subflow_can_fallback(struct mptcp_subflow_context *subflow)
|
|||
else if (READ_ONCE(msk->csum_enabled))
|
||||
return !subflow->valid_csum_seen;
|
||||
else
|
||||
return !subflow->fully_established;
|
||||
return READ_ONCE(msk->allow_infinite_fallback);
|
||||
}
|
||||
|
||||
static void mptcp_subflow_fail(struct mptcp_sock *msk, struct sock *ssk)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user