On Thu, 23 Jun 2022, Geliang Tang wrote:
> If ssn is at the right edge of DSS mapping (ssn == subflow->map_subflow_seq
> + subflow->map_data_len), it shouldn't be handled as a bad map. This
> happens in the redundant subflows test cases.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> net/mptcp/subflow.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
> index 63e8892ec807..69a2c3e6fd76 100644
> --- a/net/mptcp/subflow.c
> +++ b/net/mptcp/subflow.c
> @@ -878,8 +878,8 @@ static bool validate_mapping(struct sock *ssk, struct sk_buff *skb)
> dbg_bad_map(subflow, ssn);
> return false;
> }
> - if (unlikely(!before(ssn, subflow->map_subflow_seq +
> - subflow->map_data_len))) {
> + if (unlikely(after(ssn, subflow->map_subflow_seq +
> + subflow->map_data_len))) {
I'm not sure this correct.
For example, if subflow->map_data_len == 1, then ssn can only be equal to
subflow->map_subflow_seq. Changing this to after() allows the skb to
include an extra byte that isn't covered by the mapping.
> /* Mapping does covers past subflow data, invalid */
> dbg_bad_map(subflow, ssn);
> return false;
> --
> 2.35.3
>
>
>
--
Mat Martineau
Intel