mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
mptcp: generate subflow hmac after mptcp_finish_join()
[ Upstream commit0a4d8e96e4] For outgoing subflow join, when recv SYNACK, in subflow_finish_connect(), the mptcp_finish_join() may return false in some cases, and send a RESET to remote, and no local hmac is required. So generate subflow hmac after mptcp_finish_join(). Fixes:ec3edaa7ca("mptcp: Add handling of outgoing MP_JOIN requests") Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
284e741c4e
commit
116d5cdfac
@@ -338,15 +338,15 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
|
|||||||
goto do_reset;
|
goto do_reset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mptcp_finish_join(sk))
|
||||||
|
goto do_reset;
|
||||||
|
|
||||||
subflow_generate_hmac(subflow->local_key, subflow->remote_key,
|
subflow_generate_hmac(subflow->local_key, subflow->remote_key,
|
||||||
subflow->local_nonce,
|
subflow->local_nonce,
|
||||||
subflow->remote_nonce,
|
subflow->remote_nonce,
|
||||||
hmac);
|
hmac);
|
||||||
memcpy(subflow->hmac, hmac, MPTCPOPT_HMAC_LEN);
|
memcpy(subflow->hmac, hmac, MPTCPOPT_HMAC_LEN);
|
||||||
|
|
||||||
if (!mptcp_finish_join(sk))
|
|
||||||
goto do_reset;
|
|
||||||
|
|
||||||
subflow->mp_join = 1;
|
subflow->mp_join = 1;
|
||||||
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNACKRX);
|
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNACKRX);
|
||||||
} else if (mptcp_check_fallback(sk)) {
|
} else if (mptcp_check_fallback(sk)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user