Skip to content

Commit 9a19371

Browse files
Paolo Abenidavem330
authored andcommitted
mptcp: fix data_fin handing in RX path
The data fin flag is set only via a DSS option, but mptcp_incoming_options() copies it unconditionally from the provided RX options. Since we do not clear all the mptcp sock RX options in a socket free/alloc cycle, we can end-up with a stray data_fin value while parsing e.g. MPC packets. That would lead to mapping data corruption and will trigger a few WARN_ON() in the RX path. Instead of adding a costly memset(), fetch the data_fin flag only for DSS packets - when we always explicitly initialize such bit at option parsing time. Fixes: 648ef4b ("mptcp: Implement MPTCP receive path") Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a53c102 commit 9a19371

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/mptcp/options.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,12 +876,11 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb,
876876
mpext->data_seq = mp_opt->data_seq;
877877
mpext->subflow_seq = mp_opt->subflow_seq;
878878
mpext->dsn64 = mp_opt->dsn64;
879+
mpext->data_fin = mp_opt->data_fin;
879880
}
880881
mpext->data_len = mp_opt->data_len;
881882
mpext->use_map = 1;
882883
}
883-
884-
mpext->data_fin = mp_opt->data_fin;
885884
}
886885

887886
void mptcp_write_options(__be32 *ptr, struct mptcp_out_options *opts)

0 commit comments

Comments
 (0)