diff mbox series

[v2,4/4] mptcp: avoid processing packet if a subflow reset

Message ID 2a904c11-f78d-a493-2e4c-c5d320961ce1@163.com (mailing list archive)
State Superseded, archived
Delegated to: Paolo Abeni
Headers show
Series Fix some mptcp syncookie process bugs | expand

Commit Message

Jianguo Wu June 10, 2021, 9:28 a.m. UTC
From: Jianguo Wu <wujianguo@chinatelecom.cn>

If check_fully_established() causes a subflow reset, it should not
continue to process the packet in tcp_data_queue().

setting:
	TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;

so that the following check will drop the pkt in
tcp_data_queue():
  if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) {
	__kfree_skb(skb);
	return;
  }

Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>
---
 net/mptcp/options.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Paolo Abeni June 10, 2021, 10:22 a.m. UTC | #1
On Thu, 2021-06-10 at 17:28 +0800, Jianguo Wu wrote:
> From: Jianguo Wu <wujianguo@chinatelecom.cn>
> 
> If check_fully_established() causes a subflow reset, it should not
> continue to process the packet in tcp_data_queue().
> 
> setting:
> 	TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;
> 
> so that the following check will drop the pkt in
> tcp_data_queue():
>   if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) {
> 	__kfree_skb(skb);
> 	return;
>   }
> 
> Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>

Here a 'Fixes:' tag will be nice, I think.

Thanks,

Paolo
diff mbox series

Patch

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 1aec016..01a1bf6 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -926,6 +926,8 @@  static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
 	return true;

 reset:
+	TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;
+
 	mptcp_subflow_reset(ssk);
 	return false;
 }