Skip to contentSkip to conversation

mptcp: use MPTCP_RST_EMPTCP for ACK HMAC validation failure

PATCH In review Shardul Bankar 3 participants 5 messages Apr 27 – Apr 28

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mptcp: use MPTCP_RST_EMPTCP for ACK HMAC validation failure

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.

Fixes 443041deb5ef ("mptcp: fix NULL pointer in can_accept_new_subflow")
---
 net/mptcp/subflow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/subflow.c +1 -1
index e2cb9d23e4a0..afb174ed9c47 100644
@@ -908,7 +908,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
 
 			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;
 			}
 
Signature · 1 line
2.34.1
#1 lore raw

Hi Shardul,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/25026426180

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/206390cd6818
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1086481

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

maintainer
#3 lore raw
In reply to Shardul Bankar
Quoted 6 lines · Shardul Bankar

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.

Quoted 8 lines

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.

Fixes 443041deb5ef ("mptcp: fix NULL pointer in can_accept_new_subflow")

Small note: when you send patches only to the MPTCP ML, no need to Cc the stable ML: this line will be added when patches will be sent to the Netdev ML later.

The rest looks good to me, thank you for the patch!

Signature · 1 line
Matthieu Baerts (NGI0) <[email protected]>
maintainer
#4 lore raw
In reply to Shardul Bankar

Hi Shardul,

Quoted 10 lines · Shardul Bankar

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.

Now in our tree:

New patches for t/upstream-net and t/upstream:
- 1f2cd6a4c385: mptcp: use MPTCP_RST_EMPTCP for ACK HMAC validation failure
- Results: 718fa635acef..90cb02b20cf2 (export-net)
- Results: 8e163e999320..f68dc562c883 (export)

Tests are now in progress:

- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/883745ff4a074154bb85f2be5a3aef39774f8e83/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/6f26689671ac282704c85b27521e6b309771c544/checks

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.