Skip to content

Commit 2c5ae8a

Browse files
shardulsdk-mpiricgregkh
authored andcommitted
mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure
commit c4a99a9 upstream. In subflow_finish_connect(), HMAC validation of the server's HMAC in SYN/ACK + MP_JOIN increments MPTCP_MIB_JOINACKMAC ("HMAC was wrong on ACK + MP_JOIN") on failure. The function processes the SYN/ACK, not the ACK; the matching MPTCP_MIB_JOINSYNACKMAC counter ("HMAC was wrong on SYN/ACK + MP_JOIN") exists but is not incremented anywhere in the tree. The mirror site on the server, subflow_syn_recv_sock(), already uses JOINACKMAC correctly for ACK HMAC failure. Use JOINSYNACKMAC at the SYN/ACK validation site so each counter reflects the packet whose HMAC actually failed. Suggested-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Fixes: fc51895 ("mptcp: add and use MIB counter infrastructure") Cc: stable@vger.kernel.org Signed-off-by: Shardul Bankar <shardul.b@mpiricsoftware.com> Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20260501-net-mptcp-misc-fixes-7-1-rc3-v1-1-b70118df778e@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f77d9d9 commit 2c5ae8a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/mptcp/subflow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
581581
subflow->backup);
582582

583583
if (!subflow_thmac_valid(subflow)) {
584-
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINACKMAC);
584+
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNACKMAC);
585585
subflow->reset_reason = MPTCP_RST_EMPTCP;
586586
goto do_reset;
587587
}

0 commit comments

Comments
 (0)