Skip to content

Commit 21c02e8

Browse files
matttbekuba-moo
authored andcommitted
mptcp: only inc MPJoinAckHMacFailure for HMAC failures
Recently, during a debugging session using local MPTCP connections, I noticed MPJoinAckHMacFailure was not zero on the server side. The counter was in fact incremented when the PM rejected new subflows, because the 'subflow' limit was reached. The fix is easy, simply dissociating the two cases: only the HMAC validation check should increase MPTCP_MIB_JOINACKMAC counter. Fixes: 4cf8b7e ("subflow: introduce and use mptcp_can_accept_new_subflow()") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang <geliang@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250407-net-mptcp-hmac-failure-mib-v1-1-3c9ecd0a3a50@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 445e99b commit 21c02e8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

net/mptcp/subflow.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,13 +899,17 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
899899
goto dispose_child;
900900
}
901901

902-
if (!subflow_hmac_valid(req, &mp_opt) ||
903-
!mptcp_can_accept_new_subflow(subflow_req->msk)) {
902+
if (!subflow_hmac_valid(req, &mp_opt)) {
904903
SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINACKMAC);
905904
subflow_add_reset_reason(skb, MPTCP_RST_EPROHIBIT);
906905
goto dispose_child;
907906
}
908907

908+
if (!mptcp_can_accept_new_subflow(owner)) {
909+
subflow_add_reset_reason(skb, MPTCP_RST_EPROHIBIT);
910+
goto dispose_child;
911+
}
912+
909913
/* move the msk reference ownership to the subflow */
910914
subflow_req->msk = NULL;
911915
ctx->conn = (struct sock *)owner;

0 commit comments

Comments
 (0)