Skip to contentSkip to conversation

mptcp: Initialize map_seq upon subflow establishment

PATCH Applied Christoph Paasch 3 participants 3 messages May 11, 2020 – May 12, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mptcp: Initialize map_seq upon subflow establishment

When the other MPTCP-peer uses 32-bit data-sequence numbers, we rely on map_seq to indicate how to expand to a 64-bit data-sequence number in expand_seq() when receiving data.

For new subflows, this field is not initialized, thus results in an "invalid" mapping being discarded.

Fix this by initializing map_seq upon subflow establishment time.

Fixes f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
Signed-off-by Christoph Paasch <cpaasch(a)apple.com>
---
 net/mptcp/protocol.c | 2 ++
 1 file changed, 2 insertions(+)
net/mptcp/protocol.c +2 -0
index e1f23016ed3f..32ea8d35489a 100644
@@ -1629,6 +1629,8 @@ bool mptcp_finish_join(struct sock *sk)
 
 	ret = mptcp_pm_allow_new_subflow(msk);
 	if (ret) {
+		subflow->map_seq = msk->ack_seq;
+
 		/* active connections are already on conn_list */
 		spin_lock_bh(&msk->join_list_lock);
 		if (!WARN_ON_ONCE(!list_empty(&subflow->node)))
Signature · 1 line
2.23.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · Christoph Paasch

When the other MPTCP-peer uses 32-bit data-sequence numbers, we rely on map_seq to indicate how to expand to a 64-bit data-sequence number in expand_seq() when receiving data.

For new subflows, this field is not initialized, thus results in an "invalid" mapping being discarded.

Fix this by initializing map_seq upon subflow establishment time.

Fixes f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
Signed-off-by Christoph Paasch <cpaasch(a)apple.com>
---
 net/mptcp/protocol.c | 2 ++
 1 file changed, 2 insertions(+)
net/mptcp/protocol.c +0 -0
index e1f23016ed3f..32ea8d35489a 100644

net/mptcp/protocol.c bool mptcp_finish_join(struct sock *sk) · line 1636

Quoted 8 lines
net/mptcp/protocol.c +2 -0
@@ -1629,6 +1629,8 @@ bool mptcp_finish_join(struct sock *sk)
 
 	ret = mptcp_pm_allow_new_subflow(msk);
 	if (ret) {
+		subflow->map_seq = msk->ack_seq;
+
 		/* active connections are already on conn_list */
 		spin_lock_bh(&msk->join_list_lock);
 		if (!WARN_ON_ONCE(!list_empty(&subflow->node)))
Reviewed-by Paolo Abeni <pabeni(a)redhat.com>
maintainer Applied
#2 lore raw

From: Paolo Abeni <pabeni(a)redhat.com>
Date: Mon, 11 May 2020 19:35:21 +0200

Quoted 12 lines · Christoph Paasch
Quoted 11 lines

When the other MPTCP-peer uses 32-bit data-sequence numbers, we rely on map_seq to indicate how to expand to a 64-bit data-sequence number in expand_seq() when receiving data.

For new subflows, this field is not initialized, thus results in an "invalid" mapping being discarded.

Fix this by initializing map_seq upon subflow establishment time.

Fixes f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
Signed-off-by Christoph Paasch <cpaasch(a)apple.com>

...

Quoted 1 line
Reviewed-by Paolo Abeni <pabeni(a)redhat.com>

Applied, thanks.