Skip to contentSkip to conversation

Fix bug processing options

PATCH In review Peter Krystad 3 participants 8 messages Oct 22, 2019 – Oct 31, 2019

Subsystems (2)
lore
Share & tools
lore

Peter Krystad

author
#0 lore raw

cover Fix bug processing options

Do not process incoming options if the subflow is not MPTCP.

Observed crash when running against out-of-tree kernel with mis-matched checksum options.

Peter Krystad (2):
mptcp: Ignore incoming MPTCP options when not MP_CAPABLE
mptcp: Ignore incoming MPTCP options when not MP_CAPABLE

 net/mptcp/options.c | 3 +++
 1 file changed, 3 insertions(+)
Signature · 1 line
2.17.2
author
#1 lore raw

PATCH 1/2 mptcp: Ignore incoming MPTCP options when not MP_CAPABLE

Any options received on a fallback subflow should be ignored.

squashto: Implement MPTCP receive path

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/options.c | 3 +++
 1 file changed, 3 insertions(+)
net/mptcp/options.c +3 -0
index 8f199039971f..dcd7273e488c 100644
@@ -591,6 +591,9 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb,
 	struct mptcp_options_received *mp_opt;
 	struct mptcp_ext *mpext;
 
+	if (!subflow->mp_capable)
+		return;
+
 	mp_opt = &opt_rx->mptcp;
 
 	if (msk && mp_opt->add_addr) {
Signature · 1 line
2.17.2
author
#2 lore raw

PATCH 2/2 mptcp: Ignore incoming MPTCP options when not MP_CAPABLE

In reply to Peter Krystad

Any options received on a fallback subflow should be ignored.

squashto: Add handling of incoming MP_JOIN requests

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/options.c +1 -1
index dcd7273e488c..1b08e1193991 100644
@@ -591,7 +591,7 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb,
 	struct mptcp_options_received *mp_opt;
 	struct mptcp_ext *mpext;
 
-	if (!subflow->mp_capable)
+	if (!subflow->mp_capable && !subflow->mp_join)
 		return;
 
 	mp_opt = &opt_rx->mptcp;
Signature · 1 line
2.17.2
#3 lore raw
In reply to Peter Krystad

Hi Peter,

Quoted 2 lines · Peter Krystad

Observed crash when running against out-of-tree kernel with mis-matched checksum options.

Thank you for doing this kind of tests!

Quoted 1 line

Do not process incoming options if the subflow is not MPTCP.

Are we not supposed not to deal with MPTCP options after a fallback to TCP?

If we fallback to TCP, should we not always set 'tp->is_mptcp' to false?

Cheers,
Matt

Signature · 5 lines
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
author
#4 lore raw
Quoted 7 lines · Matthieu Baerts

Hi Peter,

Quoted 2 lines · Peter Krystad

Observed crash when running against out-of-tree kernel with mis-matched checksum options.

Thank you for doing this kind of tests!

It was an accident, I forgot to disable checksum on the out-of-tree side...

Quoted 6 lines
Quoted 2 lines

Do not process incoming options if the subflow is not MPTCP.

Are we not supposed not to deal with MPTCP options after a fallback to TCP?

If we fallback to TCP, should we not always set 'tp->is_mptcp' to false?

Currently for fallback we set is_mptcp=0 after the connection negotiation is complete [in mptcp_accept()] and presumeably everything is fine after that point. In this specific situation (we don't send MP_CAPABLE in the third ack because we don't support checksum) the out-of-tree kernel resends the syn-ack with DSS options, and these packets are processed before is_mptcp is cleared. I think we are in uncharted territory here because of how we reject the other sides request for checksums, but this check can't hurt.

Peter.

Quoted 3 lines

Cheers,
Matt

#5 lore raw
In reply to Peter Krystad
Quoted 5 lines · Peter Krystad

Do not process incoming options if the subflow is not MPTCP.

Observed crash when running against out-of-tree kernel with mis-matched checksum options.

Quoted 7 lines

Peter Krystad (2):
mptcp: Ignore incoming MPTCP options when not MP_CAPABLE
mptcp: Ignore incoming MPTCP options when not MP_CAPABLE

net/mptcp/options.c | 3 +++

1 file changed, 3 insertions(+)

Both changes look good to me. Thanks, Peter!

--
Mat Martineau
Intel

#6 lore raw

Hi Peter, Mat,

Quoted 12 lines · Mat Martineau
Quoted 9 lines · Peter Krystad

Do not process incoming options if the subflow is not MPTCP.

Observed crash when running against out-of-tree kernel with mis-matched checksum options.

Peter Krystad (2):
 mptcp: Ignore incoming MPTCP options when not MP_CAPABLE
 mptcp: Ignore incoming MPTCP options when not MP_CAPABLE

Quoted 5 lines
Quoted 3 lines

net/mptcp/options.c | 3 +++

1 file changed, 3 insertions(+)

Both changes look good to me. Thanks, Peter!

Thank you for the patches and the reviews!

- 6eb607af7475: "squashed" patch 1/2 in "mptcp: Implement MPTCP receive path"
- ea443b296417: "squashed" patch 2/2 in "mptcp: Add handling of outgoing MP_JOIN requests"
- 22b6803a0c48..a89f2feb5b90: result

Tests are still OK!

Cheers,
Matt

Signature · 5 lines
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
#7 lore raw

Hi,

It seems this email I wanted to send end of last week didn't go through.

Quoted 23 lines · Matthieu Baerts

Hi Peter, Mat,

Quoted 12 lines · Mat Martineau
Quoted 9 lines · Peter Krystad

Do not process incoming options if the subflow is not MPTCP.

Observed crash when running against out-of-tree kernel with mis-matched checksum options.

Peter Krystad (2):
 mptcp: Ignore incoming MPTCP options when not MP_CAPABLE
 mptcp: Ignore incoming MPTCP options when not MP_CAPABLE

Quoted 5 lines
Quoted 3 lines

net/mptcp/options.c | 3 +++

1 file changed, 3 insertions(+)

Both changes look good to me. Thanks, Peter!

Thank you for the patches and the reviews!

Quoted 7 lines

- 6eb607af7475: "squashed" patch 1/2 in "mptcp: Implement MPTCP receive path"
- ea443b296417: "squashed" patch 2/2 in "mptcp: Add handling of outgoing MP_JOIN requests"
- 22b6803a0c48..a89f2feb5b90: result

Tests are still OK!

I had to do a small change to allow the compilation of each commit:

net/mptcp/options.c +0 -0
index ca589ab9a02a..bbf9e9aa53da 100644
@@ -391,6 +391,7 @@ bool mptcp_synack_options(const struct request_sock 

*req, unsigned int *size,
void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb,
struct tcp_options_received *opt_rx)
{

+       struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
         struct mptcp_options_received *mp_opt;
         struct mptcp_ext *mpext;

The subflow variable is declared later on in "mptcp: Add path manager interface"

- c559c9eb4f9f: "squashed" in "mptcp: Implement MPTCP receive path"
- 9c984d940c41: conflict in t/mptcp-Add-path-manager-interface
- no diff at the end.

Cheers,
Matt

Signature · 5 lines
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