diff mbox series

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

Message ID 1623726146-5911-5-git-send-email-wujianguo106@163.com (mailing list archive)
State Superseded, archived
Delegated to: Mat Martineau
Headers show
Series Fix some mptcp syncookie process bugs | expand

Commit Message

Jianguo Wu June 15, 2021, 3:02 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;
  }

Fixes: d582484726c4 ("mptcp: fix fallback for MP_JOIN subflows")
Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>
---
 net/mptcp/options.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Florian Westphal June 15, 2021, 3:19 p.m. UTC | #1
wujianguo106@163.com <wujianguo106@163.com> wrote:
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index 1aec01686c1a..01a1bf60b187 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;

Magic.  Please at least add a comment here.
Jianguo Wu June 16, 2021, 7:02 a.m. UTC | #2
Hi Florian,

On 2021/6/15 23:19, Florian Westphal wrote:
> wujianguo106@163.com <wujianguo106@163.com> wrote:
>> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
>> index 1aec01686c1a..01a1bf60b187 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;
> 
> Magic.  Please at least add a comment here.
> 

Ok, will add a comment, thanks!
diff mbox series

Patch

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 1aec01686c1a..01a1bf60b187 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;
 }