Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH mptcp-net] mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure
@ 2026-04-28  7:48 Shardul Bankar
  2026-04-29 17:25 ` Matthieu Baerts
  2026-04-29 17:41 ` Matthieu Baerts
  0 siblings, 2 replies; 3+ messages in thread
From: Shardul Bankar @ 2026-04-28  7:48 UTC (permalink / raw)
  To: mptcp
  Cc: matttbe, martineau, geliang, pabeni, janak, kalpan.jani,
	shardulsb08, Shardul Bankar, stable

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: 3eccc998b50b ("mptcp: increment MIB counters in a few places")
Cc: stable@vger.kernel.org
Signed-off-by: Shardul Bankar <shardul.b@mpiricsoftware.com>
---
 net/mptcp/subflow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index e2cb9d23e4a0..bda6862264ca 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -581,7 +581,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
 			 subflow->backup);
 
 		if (!subflow_thmac_valid(subflow)) {
-			MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINACKMAC);
+			MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNACKMAC);
 			subflow->reset_reason = MPTCP_RST_EMPTCP;
 			goto do_reset;
 		}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH mptcp-net] mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure
  2026-04-28  7:48 [PATCH mptcp-net] mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure Shardul Bankar
@ 2026-04-29 17:25 ` Matthieu Baerts
  2026-04-29 17:41 ` Matthieu Baerts
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Baerts @ 2026-04-29 17:25 UTC (permalink / raw)
  To: Shardul Bankar, mptcp
  Cc: martineau, geliang, pabeni, janak, kalpan.jani, shardulsb08,
	stable

Hi Shardul,

On 28/04/2026 09:48, Shardul Bankar wrote:
> 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: 3eccc998b50b ("mptcp: increment MIB counters in a few places")

Thank you for this patch! It looks good to me, except this Fixes tag:
how did you get it? It is only available from an old archived branch:

  archived/t/upstream_20200401

Note that AI Coding Assistants are allowed, but the Assisted-by mention
is then required, see:

  https://docs.kernel.org/process/coding-assistants.html

Git blame should be done from the net/net-next branches or the
export/export-net ones.

I'm going to use this one instead:

Fixes: fc518953bc9c ("mptcp: add and use MIB counter infrastructure")

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH mptcp-net] mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure
  2026-04-28  7:48 [PATCH mptcp-net] mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure Shardul Bankar
  2026-04-29 17:25 ` Matthieu Baerts
@ 2026-04-29 17:41 ` Matthieu Baerts
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Baerts @ 2026-04-29 17:41 UTC (permalink / raw)
  To: Shardul Bankar, mptcp
  Cc: martineau, geliang, pabeni, janak, kalpan.jani, shardulsb08,
	stable

Hi Shardul,

On 28/04/2026 09:48, Shardul Bankar wrote:
> 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.

Now in our tree (fixes for -net):

New patches for t/upstream-net and t/upstream:
- aec458ef6eb7: mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure
- Results: 581441b9adeb..4d36cf47658c (export-net)
- Results: d1636d717db9..83e40a2e5ca0 (export)

Tests are now in progress:

- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/35ef198760c9a2bea1ce2edb5f5d503bef518644/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/8a8f6fca4cf7c8d0b2f1f949e481a3d6840f3286/checks

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-29 17:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28  7:48 [PATCH mptcp-net] mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure Shardul Bankar
2026-04-29 17:25 ` Matthieu Baerts
2026-04-29 17:41 ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox