Skip to content

Commit c166527

Browse files
edumazetkuba-moo
authored andcommitted
mptcp: strict validation before using mp_opt->hmac
mp_opt->hmac contains uninitialized data unless OPTION_MPTCP_MPJ_ACK was set in mptcp_parse_option(). We must refine the condition before we call subflow_hmac_valid(). Fixes: f296234 ("mptcp: Add handling of incoming MP_JOIN requests") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Florian Westphal <fw@strlen.de> Cc: Peter Krystad <peter.krystad@linux.intel.com> Cc: Matthieu Baerts <matttbe@kernel.org> Cc: Mat Martineau <martineau@kernel.org> Cc: Geliang Tang <geliang.tang@linux.dev> Reviewed-by: Simon Horman <horms@kernel.org> Acked-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Mat Martineau <martineau@kernel.org> Link: https://lore.kernel.org/r/20240111194917.4044654-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 89e2327 commit c166527

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
@@ -788,7 +788,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
788788

789789
} else if (subflow_req->mp_join) {
790790
mptcp_get_options(skb, &mp_opt);
791-
if (!(mp_opt.suboptions & OPTIONS_MPTCP_MPJ) ||
791+
if (!(mp_opt.suboptions & OPTION_MPTCP_MPJ_ACK) ||
792792
!subflow_hmac_valid(req, &mp_opt) ||
793793
!mptcp_can_accept_new_subflow(subflow_req->msk)) {
794794
SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINACKMAC);

0 commit comments

Comments
 (0)