linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2] mptcp: bugfix for RM_ADDR option parsing
@ 2020-06-08 10:47 Geliang Tang
  2020-06-08 11:19 ` Matthieu Baerts
  2020-06-09  2:11 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Geliang Tang @ 2020-06-08 10:47 UTC (permalink / raw)
  To: Mat Martineau, Matthieu Baerts, David S. Miller, Jakub Kicinski,
	Paolo Abeni, Peter Krystad
  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.

Fixes: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 Changes in v2:
  - Add "-net" subject and "Fixes" tag as Matt suggested.
---
 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] 3+ messages in thread

* Re: [PATCH net v2] mptcp: bugfix for RM_ADDR option parsing
  2020-06-08 10:47 [PATCH net v2] mptcp: bugfix for RM_ADDR option parsing Geliang Tang
@ 2020-06-08 11:19 ` Matthieu Baerts
  2020-06-09  2:11 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Baerts @ 2020-06-08 11:19 UTC (permalink / raw)
  To: Geliang Tang, Mat Martineau, David S. Miller, Jakub Kicinski,
	Paolo Abeni, Peter Krystad
  Cc: netdev, mptcp, linux-kernel

Hi Geliang,

On 08/06/2020 12:47, 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.
> 
> Fixes: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
>   Changes in v2:
>    - Add "-net" subject and "Fixes" tag as Matt suggested.

Thanks for this v2! LGTM!

Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>

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] 3+ messages in thread

* Re: [PATCH net v2] mptcp: bugfix for RM_ADDR option parsing
  2020-06-08 10:47 [PATCH net v2] mptcp: bugfix for RM_ADDR option parsing Geliang Tang
  2020-06-08 11:19 ` Matthieu Baerts
@ 2020-06-09  2:11 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-06-09  2:11 UTC (permalink / raw)
  To: geliangtang
  Cc: mathew.j.martineau, matthieu.baerts, kuba, pabeni, peter.krystad,
	netdev, mptcp, linux-kernel

From: Geliang Tang <geliangtang@gmail.com>
Date: Mon,  8 Jun 2020 18:47:54 +0800

> 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.
> 
> Fixes: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
>  Changes in v2:
>   - Add "-net" subject and "Fixes" tag as Matt suggested.

Applied and queued up for v5.7 -stable, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-09  2:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 10:47 [PATCH net v2] mptcp: bugfix for RM_ADDR option parsing Geliang Tang
2020-06-08 11:19 ` Matthieu Baerts
2020-06-09  2:11 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).