MPTCP Linux Development
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Geliang Tang <geliang.tang@suse.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v9 2/6] mptcp: accept right edge of mapping validating
Date: Thu, 23 Jun 2022 17:59:07 -0700 (PDT)	[thread overview]
Message-ID: <8e4e2b9f-44e4-adeb-8d3-6a76a7799f3d@linux.intel.com> (raw)
In-Reply-To: <6f5dffe33bd23ea18ec8cff99c8944e9d0f9c6fe.1655995770.git.geliang.tang@suse.com>

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

  reply	other threads:[~2022-06-24  0:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 14:54 [PATCH mptcp-next v9 0/6] BPF redundant scheduler Geliang Tang
2022-06-23 14:54 ` [PATCH mptcp-next v9 1/6] Squash to "mptcp: add get_subflow wrappers" Geliang Tang
2022-06-23 14:54 ` [PATCH mptcp-next v9 2/6] mptcp: accept right edge of mapping validating Geliang Tang
2022-06-24  0:59   ` Mat Martineau [this message]
2022-06-23 14:54 ` [PATCH mptcp-next v9 3/6] mptcp: redundant subflows push pending Geliang Tang
2022-06-24  1:20   ` Mat Martineau
2022-06-23 14:54 ` [PATCH mptcp-next v9 4/6] mptcp: redundant subflows retrans support Geliang Tang
2022-06-23 14:54 ` [PATCH mptcp-next v9 5/6] selftests/bpf: Add bpf_red scheduler Geliang Tang
2022-06-23 14:54 ` [PATCH mptcp-next v9 6/6] selftests/bpf: Add bpf_red test Geliang Tang
2022-06-23 16:20   ` selftests/bpf: Add bpf_red test: Tests Results MPTCP CI
2022-06-23 14:57 ` [PATCH mptcp-next v9 0/6] BPF redundant scheduler Matthieu Baerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e4e2b9f-44e4-adeb-8d3-6a76a7799f3d@linux.intel.com \
    --to=mathew.j.martineau@linux.intel.com \
    --cc=geliang.tang@suse.com \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox