Squash to "mptcp: add deny_join_id0 in mptcp_options_received"
Subsystems (3)
PATCH 1/1 Squash to "mptcp: add deny_join_id0 in mptcp_options_received"
Please add this line to the commit log:
'''
In mptcp_finish_join, add the incomming join address check too. '''
--- net/mptcp/protocol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mptcp/protocol.c +2 -1
@@ -3116,7 +3116,8 @@ bool mptcp_finish_join(struct sock *ssk)if (!msk->pm.server_side) goto out; -if (!mptcp_pm_allow_new_subflow (msk)) { +if (!mptcp_pm_allow_new_subflow (msk) || + (READ_ONCE (msk->pm.remote_deny_join_id0) && !subflow->remote_id)) { subflow->reset_reason =MPTCP_RST_EPROHIBIT ;return false; }
Signature · 1 line
2.31.1
PATCH 1/1 Squash to "selftests: mptcp: add deny_join_id0 testcases"
Update the testcases.
--- .../testing/selftests/net/mptcp/mptcp_join.sh | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +26 -9
@@ -1491,24 +1491,41 @@ deny_join_id0_tests() run_tests $ns1 $ns2 10.0.1.1 chk_join_nr "single subflow allow join id0 ns2" 0 0 0 - # subflow and address allow join id0 + # signal address allow join id0 ns1 + reset_with_allow_join_id0 1 0 + ip netns exec $ns1 ./pm_nl_ctl limits 1 1 + ip netns exec $ns2 ./pm_nl_ctl limits 1 1 + ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "signal address allow join id0 ns1" 1 1 0 + chk_add_nr 1 1 + + # signal address allow join id0 ns2 + reset_with_allow_join_id0 0 1 + ip netns exec $ns1 ./pm_nl_ctl limits 1 1 + ip netns exec $ns2 ./pm_nl_ctl limits 1 1 + ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "signal address allow join id0 ns2" 1 1 1 + chk_add_nr 1 1 + + # subflow and address allow join id0 ns1 reset_with_allow_join_id0 0 1 ip netns exec $ns1 ./pm_nl_ctl limits 2 2 ip netns exec $ns2 ./pm_nl_ctl limits 2 2 ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr "subflow and address allow join id0" 2 2 2 + chk_join_nr "subflow and address allow join id0 1" 2 2 2 - # signal address allow join id0 - # ADD_ADDRs are not affected by allow_join_id0 value. - reset_with_allow_join_id0 0 0 - ip netns exec $ns1 ./pm_nl_ctl limits 1 1 - ip netns exec $ns2 ./pm_nl_ctl limits 1 1 + # subflow and address allow join id0 ns2 + reset_with_allow_join_id0 1 0 + ip netns exec $ns1 ./pm_nl_ctl limits 2 2 + ip netns exec $ns2 ./pm_nl_ctl limits 2 2 ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal + ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr "signal address allow join id0" 1 1 1 - chk_add_nr 1 1 + chk_join_nr "subflow and address allow join id0 2" 2 2 1 } all_tests()
Signature · 1 line
2.31.1
Re: [MPTCP][PATCH mptcp-next] Squash to "selftests: mptcp: add deny_join_id0 testcases"
Quoted 2 lines · Geliang Tang
Update the testcases.
Since there are now other changes to v6, please include the selftest updates in v7 of the 'c' bit patchset. Thanks.
Mat
Quoted 51 lines
Signed-off-by Geliang Tang <[email protected]>---
.../testing/selftests/net/mptcp/mptcp_join.sh| 35 ++++++++++++++-----1 file changed, 26 insertions(+), 9 deletions(-)tools/testing/selftests/net/mptcp/mptcp_join.sh +23
-7@@ -1491,24 +1491,41 @@ deny_join_id0_tests() run_tests $ns1 $ns2 10.0.1.1 chk_join_nr "single subflow allow join id0 ns2" 0 0 0 - # subflow and address allow join id0 + # signal address allow join id0 ns1 + reset_with_allow_join_id0 1 0 + ip netns exec $ns1 ./pm_nl_ctl limits 1 1 + ip netns exec $ns2 ./pm_nl_ctl limits 1 1 + ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "signal address allow join id0 ns1" 1 1 0 + chk_add_nr 1 1 + + # signal address allow join id0 ns2 + reset_with_allow_join_id0 0 1 + ip netns exec $ns1 ./pm_nl_ctl limits 1 1 + ip netns exec $ns2 ./pm_nl_ctl limits 1 1 + ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "signal address allow join id0 ns2" 1 1 1 + chk_add_nr 1 1 + + # subflow and address allow join id0 ns1 reset_with_allow_join_id0 0 1 ip netns exec $ns1 ./pm_nl_ctl limits 2 2 ip netns exec $ns2 ./pm_nl_ctl limits 2 2 ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr "subflow and address allow join id0" 2 2 2 + chk_join_nr "subflow and address allow join id0 1" 2 2 2 - # signal address allow join id0 - # ADD_ADDRs are not affected by allow_join_id0 value. - reset_with_allow_join_id0 0 0 - ip netns exec $ns1 ./pm_nl_ctl limits 1 1 - ip netns exec $ns2 ./pm_nl_ctl limits 1 1 + # subflow and address allow join id0 ns2 + reset_with_allow_join_id0 1 0 + ip netns exec $ns1 ./pm_nl_ctl limits 2 2
tools/testing/selftests/net/mptcp/mptcp_join.sh deny_join_id0_tests() · line 1531
Quoted 10 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +3
-2+ ip netns exec $ns2 ./pm_nl_ctl limits 2 2 ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal + ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr "signal address allow join id0" 1 1 1 - chk_add_nr 1 1 + chk_join_nr "subflow and address allow join id0 2" 2 2 1 } all_tests()
--
Mat Martineau
Intel
Quoted 16 lines · Geliang Tang
Please add this line to the commit log:
'''
Inmptcp_finish_join, add the incomming join address check too. '''Signed-off-by Geliang Tang <[email protected]>---
net/mptcp/protocol.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)net/mptcp/protocol.c +0
-0
net/mptcp/protocol.c bool mptcp_finish_join(struct sock *ssk) · line 3120
Quoted 6 lines
net/mptcp/protocol.c +2
-1@@ -3116,7 +3116,8 @@ bool mptcp_finish_join(struct sock *ssk)if (!msk->pm.server_side) goto out; -if (!mptcp_pm_allow_new_subflow (msk)) { +if (!mptcp_pm_allow_new_subflow (msk) || + (READ_ONCE (msk->pm.remote_deny_join_id0) && !subflow->remote_id)) {
This checks whether this side received a C==1 bit from the remote - but that's already checked in mptcp_pm_create_subflow_or_signal_addr().
What might be needed is a check in the opposite direction: if this side *sent* C==1, and the incoming MP_JOIN is for the initial addr/port, that's invalid.
Not sure yet how we are going to interpret the RFC on this, will be discussing at the meeting tomorrow.
Quoted 5 lines
net/mptcp/protocol.c +0
-0subflow->reset_reason =MPTCP_RST_EPROHIBIT ;return false; }Signature · 1 line
2.31.1
--
Mat Martineau
Intel
Quoted 28 lines · Mat Martineau
Quoted 16 lines · Geliang Tang
Please add this line to the commit log:
'''
Inmptcp_finish_join, add the incomming join address check too. '''Signed-off-by Geliang Tang <[email protected]>---
net/mptcp/protocol.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)net/mptcp/protocol.c +0
-0net/mptcp/protocol.c bool mptcp_finish_join(struct sock *ssk) · line 3121
Quoted 7 lines
net/mptcp/protocol.c +2
-1@@ -3116,7 +3116,8 @@ bool mptcp_finish_join(struct sock *ssk)if (!msk->pm.server_side) goto out; -if (!mptcp_pm_allow_new_subflow (msk)) { +if (!mptcp_pm_allow_new_subflow (msk) || + (READ_ONCE (msk->pm.remote_deny_join_id0) && !subflow->remote_id)) {This checks whether this side received a C==1 bit from the remote - but that's already checked in
mptcp_pm_create_subflow_or_signal_addr().
Quoted 3 lines
What might be needed is a check in the opposite direction: if this side *sent* C==1, and the incoming
MP_JOINis for the initial addr/port, that's invalid.Not sure yet how we are going to interpret the RFC on this, will be discussing at the meeting tomorrow.
I meant "our next scheduled community meeting" :)
Quoted 7 lines
Quoted 7 lines
net/mptcp/protocol.c +0
-0subflow->reset_reason =MPTCP_RST_EPROHIBIT ;return false;}Signature · 1 line
2.31.1
--
Mat Martineau
Intel