]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mptcp: use MPTCP_RST_EMPTCP for ACK HMAC validation failure
authorShardul Bankar <shardul.b@mpiricsoftware.com>
Fri, 1 May 2026 19:35:35 +0000 (21:35 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 5 May 2026 02:20:50 +0000 (19:20 -0700)
When HMAC validation fails on a received ACK + MP_JOIN in
subflow_syn_recv_sock(), the subflow is reset with reason
MPTCP_RST_EPROHIBIT ("Administratively prohibited"). This is
incorrect: HMAC validation failure is an MPTCP protocol-level
error, not an administrative policy denial.

The mirror site on the client, in subflow_finish_connect(), already
uses MPTCP_RST_EMPTCP ("MPTCP-specific error") for the same kind of
HMAC failure on the SYN/ACK + MP_JOIN. Use the same reason on the
server side for symmetry and accuracy.

Suggested-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Fixes: 443041deb5ef ("mptcp: fix NULL pointer in can_accept_new_subflow")
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-2-b70118df778e@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/subflow.c

index bda6862264ca4aa1ab943f7066c7ee69d46aab7c..d562e149606f604873ba0812dafbab04c495856d 100644 (file)
@@ -908,7 +908,7 @@ create_child:
 
                        if (!subflow_hmac_valid(subflow_req, &mp_opt)) {
                                SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINACKMAC);
-                               subflow_add_reset_reason(skb, MPTCP_RST_EPROHIBIT);
+                               subflow_add_reset_reason(skb, MPTCP_RST_EMPTCP);
                                goto dispose_child;
                        }