Skip to contentSkip to conversation

Squash to "mptcp: add rm_list_tx in mptcp_pm_data"

PATCH In review Geliang Tang 3 participants 3 messages Feb 18, 2021 – Feb 22, 2021

Subsystems (2)
lore
Share & tools
lore

Geliang Tang

author
#0 lore raw

PATCH v2 1/1 Squash to "mptcp: add rm_list_tx in mptcp_pm_data"

Fix the length of RM_ADDR suboption in mptcp_pm_rm_addr_signal.

Signed-off-by Geliang Tang <geliangtang(a)gmail.com>

---
v2:
- clear msk->pm.addr_signal in the error case.

---
 net/mptcp/pm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
net/mptcp/pm.c +7 -2
index 32f203f186a2..f3db3adfe3fc 100644
@@ -260,7 +260,7 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
 bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
 			     struct mptcp_rm_list *rm_list)
 {
-	int ret = false;
+	int ret = false, len;
 
 	spin_lock_bh(&msk->pm.lock);
 
@@ -268,7 +268,12 @@ bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
 	if (!mptcp_pm_should_rm_signal(msk))
 		goto out_unlock;
 
-	if (remaining < TCPOLEN_MPTCP_RM_ADDR_BASE)
+	len = mptcp_rm_addr_len(msk->pm.rm_list_tx);
+	if (len < 0) {
+		WRITE_ONCE(msk->pm.addr_signal, 0);
+		goto out_unlock;
+	}
+	if (remaining < len)
 		goto out_unlock;
 
 	*rm_list = msk->pm.rm_list_tx;
Signature · 1 line
2.29.2
#1 lore raw
Quoted 39 lines · Geliang Tang

Fix the length of RM_ADDR suboption in mptcp_pm_rm_addr_signal.

Signed-off-by Geliang Tang <geliangtang(a)gmail.com>

---
v2:
- clear msk->pm.addr_signal in the error case.
---
net/mptcp/pm.c | 9 +++++++--

1 file changed, 7 insertions(+), 2 deletions(-)
net/mptcp/pm.c +7 -2
index 32f203f186a2..f3db3adfe3fc 100644
@@ -260,7 +260,7 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
 bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
 			     struct mptcp_rm_list *rm_list)
 {
-	int ret = false;
+	int ret = false, len;
 
 	spin_lock_bh(&msk->pm.lock);
 
@@ -268,7 +268,12 @@ bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
 	if (!mptcp_pm_should_rm_signal(msk))
 		goto out_unlock;
 
-	if (remaining < TCPOLEN_MPTCP_RM_ADDR_BASE)
+	len = mptcp_rm_addr_len(msk->pm.rm_list_tx);
+	if (len < 0) {
+		WRITE_ONCE(msk->pm.addr_signal, 0);
+		goto out_unlock;
+	}
+	if (remaining < len)
 		goto out_unlock;
 
 	*rm_list = msk->pm.rm_list_tx;
Signature · 1 line
2.29.2

Thanks for the v2, looks ready to squash.

--
Mat Martineau
Intel

#2 lore raw
In reply to Geliang Tang

Hi Geliang, Mat,

Quoted 1 line · Geliang Tang

Fix the length of RM_ADDR suboption in mptcp_pm_rm_addr_signal.

Thank you for the patch and the review!

- 2435fca3083c: "squashed" in "mptcp: add rm_list_tx in mptcp_pm_data"
- Results: 98202724d8a6..253897668c44

Tests + export are going to be started soon!

Cheers,
Matt

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net