* [MPTCP] [PATCH] mptcp: bugfix for RM_ADDR option parsing
@ 2020-06-08 7:48 ` Geliang Tang
0 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2020-06-08 7:48 UTC (permalink / raw)
To: mptcp
[-- Attachment #1: Type: text/plain, Size: 943 bytes --]
In MPTCPOPT_RM_ADDR option parsing, the pointer "ptr" pointed to the
"Subtype" octet, the pointer "ptr+1" pointed to the "Address ID" octet:
+-------+-------+---------------+
|Subtype|(resvd)| Address ID |
+-------+-------+---------------+
| |
ptr ptr+1
We should set mp_opt->rm_id to the value of "ptr+1", not "ptr". This patch
will fix this bug.
Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
---
net/mptcp/options.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 01f1f4cf4902..490b92534afc 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -273,6 +273,8 @@ static void mptcp_parse_option(const struct sk_buff *skb,
if (opsize != TCPOLEN_MPTCP_RM_ADDR_BASE)
break;
+ ptr++;
+
mp_opt->rm_addr = 1;
mp_opt->rm_id = *ptr++;
pr_debug("RM_ADDR: id=%d", mp_opt->rm_id);
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] mptcp: bugfix for RM_ADDR option parsing
@ 2020-06-08 7:48 ` Geliang Tang
0 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2020-06-08 7:48 UTC (permalink / raw)
To: Mat Martineau, Matthieu Baerts, David S. Miller, Jakub Kicinski
Cc: Geliang Tang, netdev, mptcp, linux-kernel
In MPTCPOPT_RM_ADDR option parsing, the pointer "ptr" pointed to the
"Subtype" octet, the pointer "ptr+1" pointed to the "Address ID" octet:
+-------+-------+---------------+
|Subtype|(resvd)| Address ID |
+-------+-------+---------------+
| |
ptr ptr+1
We should set mp_opt->rm_id to the value of "ptr+1", not "ptr". This patch
will fix this bug.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
net/mptcp/options.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 01f1f4cf4902..490b92534afc 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -273,6 +273,8 @@ static void mptcp_parse_option(const struct sk_buff *skb,
if (opsize != TCPOLEN_MPTCP_RM_ADDR_BASE)
break;
+ ptr++;
+
mp_opt->rm_addr = 1;
mp_opt->rm_id = *ptr++;
pr_debug("RM_ADDR: id=%d", mp_opt->rm_id);
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [MPTCP] Re: [PATCH] mptcp: bugfix for RM_ADDR option parsing
2020-06-08 7:48 ` Geliang Tang
@ 2020-06-08 10:10 ` Matthieu Baerts
-1 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts @ 2020-06-08 10:10 UTC (permalink / raw)
To: mptcp
[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]
Hi Geliang,
On 08/06/2020 09:48, Geliang Tang wrote:
> In MPTCPOPT_RM_ADDR option parsing, the pointer "ptr" pointed to the
> "Subtype" octet, the pointer "ptr+1" pointed to the "Address ID" octet:
>
> +-------+-------+---------------+
> |Subtype|(resvd)| Address ID |
> +-------+-------+---------------+
> | |
> ptr ptr+1
>
> We should set mp_opt->rm_id to the value of "ptr+1", not "ptr". This patch
> will fix this bug.
Thank you for the patch, good catch!
Indeed "ptr" should be incremented.
Because this is a bug-fix for net, may you clearly indicate that in the
subject to help -net maintainers please? [PATCH net v2]
Also, may you add a "Fixes" tag as well as it is for -net ? I guess it
should be:
Fixes: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
The rest is good!
Cheers,
Matt
--
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mptcp: bugfix for RM_ADDR option parsing
@ 2020-06-08 10:10 ` Matthieu Baerts
0 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts @ 2020-06-08 10:10 UTC (permalink / raw)
To: Geliang Tang
Cc: Mat Martineau, David S. Miller, Jakub Kicinski, netdev, mptcp,
linux-kernel
Hi Geliang,
On 08/06/2020 09:48, Geliang Tang wrote:
> In MPTCPOPT_RM_ADDR option parsing, the pointer "ptr" pointed to the
> "Subtype" octet, the pointer "ptr+1" pointed to the "Address ID" octet:
>
> +-------+-------+---------------+
> |Subtype|(resvd)| Address ID |
> +-------+-------+---------------+
> | |
> ptr ptr+1
>
> We should set mp_opt->rm_id to the value of "ptr+1", not "ptr". This patch
> will fix this bug.
Thank you for the patch, good catch!
Indeed "ptr" should be incremented.
Because this is a bug-fix for net, may you clearly indicate that in the
subject to help -net maintainers please? [PATCH net v2]
Also, may you add a "Fixes" tag as well as it is for -net ? I guess it
should be:
Fixes: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
The rest is good!
Cheers,
Matt
--
Matthieu Baerts | R&D Engineer
matthieu.baerts@tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
^ permalink raw reply [flat|nested] 6+ messages in thread
* [MPTCP] Re: [PATCH] mptcp: bugfix for RM_ADDR option parsing
2020-06-08 10:10 ` Matthieu Baerts
@ 2020-06-08 10:59 ` Geliang Tang
-1 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2020-06-08 10:59 UTC (permalink / raw)
To: mptcp
[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]
On Mon, Jun 08, 2020 at 12:10:23PM +0200, Matthieu Baerts wrote:
> Hi Geliang,
>
> On 08/06/2020 09:48, Geliang Tang wrote:
> > In MPTCPOPT_RM_ADDR option parsing, the pointer "ptr" pointed to the
> > "Subtype" octet, the pointer "ptr+1" pointed to the "Address ID" octet:
> >
> > +-------+-------+---------------+
> > |Subtype|(resvd)| Address ID |
> > +-------+-------+---------------+
> > | |
> > ptr ptr+1
> >
> > We should set mp_opt->rm_id to the value of "ptr+1", not "ptr". This patch
> > will fix this bug.
>
> Thank you for the patch, good catch!
> Indeed "ptr" should be incremented.
>
> Because this is a bug-fix for net, may you clearly indicate that in the
> subject to help -net maintainers please? [PATCH net v2]
>
> Also, may you add a "Fixes" tag as well as it is for -net ? I guess it
> should be:
>
> Fixes: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
>
> The rest is good!
>
> Cheers,
> Matt
> --
> Matthieu Baerts | R&D Engineer
> matthieu.baerts(a)tessares.net
> Tessares SA | Hybrid Access Solutions
> www.tessares.net
> 1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
Hi Matt,
Thanks for your reply.
I have already resend patch v2 to you.
-Geliang
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mptcp: bugfix for RM_ADDR option parsing
@ 2020-06-08 10:59 ` Geliang Tang
0 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2020-06-08 10:59 UTC (permalink / raw)
To: Matthieu Baerts
Cc: Mat Martineau, Matthieu Baerts, David S. Miller, Jakub Kicinski,
Paolo Abeni, Peter Krystad, netdev, mptcp, linux-kernel
On Mon, Jun 08, 2020 at 12:10:23PM +0200, Matthieu Baerts wrote:
> Hi Geliang,
>
> On 08/06/2020 09:48, Geliang Tang wrote:
> > In MPTCPOPT_RM_ADDR option parsing, the pointer "ptr" pointed to the
> > "Subtype" octet, the pointer "ptr+1" pointed to the "Address ID" octet:
> >
> > +-------+-------+---------------+
> > |Subtype|(resvd)| Address ID |
> > +-------+-------+---------------+
> > | |
> > ptr ptr+1
> >
> > We should set mp_opt->rm_id to the value of "ptr+1", not "ptr". This patch
> > will fix this bug.
>
> Thank you for the patch, good catch!
> Indeed "ptr" should be incremented.
>
> Because this is a bug-fix for net, may you clearly indicate that in the
> subject to help -net maintainers please? [PATCH net v2]
>
> Also, may you add a "Fixes" tag as well as it is for -net ? I guess it
> should be:
>
> Fixes: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
>
> The rest is good!
>
> Cheers,
> Matt
> --
> Matthieu Baerts | R&D Engineer
> matthieu.baerts@tessares.net
> Tessares SA | Hybrid Access Solutions
> www.tessares.net
> 1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
Hi Matt,
Thanks for your reply.
I have already resend patch v2 to you.
-Geliang
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-06-08 11:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 7:48 [MPTCP] [PATCH] mptcp: bugfix for RM_ADDR option parsing Geliang Tang
2020-06-08 7:48 ` Geliang Tang
2020-06-08 10:10 [MPTCP] " Matthieu Baerts
2020-06-08 10:10 ` Matthieu Baerts
2020-06-08 10:59 [MPTCP] " Geliang Tang
2020-06-08 10:59 ` Geliang Tang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.