Skip to content

Commit

Permalink
mptcp: avoid a WARN on bad input.
Browse files Browse the repository at this point in the history
Syzcaller has found a way to trigger the WARN_ON_ONCE condition
in check_fully_established().

The root cause is a legit fallback to TCP scenario, so replace
the WARN with a plain message on a more strict condition.

Fixes: f296234 ("mptcp: Add handling of incoming MP_JOIN requests")
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Paolo Abeni authored and davem330 committed Apr 30, 2020
1 parent cfde141 commit d6085fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/mptcp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,6 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *sk,
goto fully_established;
}

WARN_ON_ONCE(subflow->can_ack);

/* If the first established packet does not contain MP_CAPABLE + data
* then fallback to TCP
*/
Expand All @@ -714,6 +712,8 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *sk,
return false;
}

if (unlikely(!READ_ONCE(msk->pm.server_side)))
pr_warn_once("bogus mpc option on established client sk");
subflow->fully_established = 1;
subflow->remote_key = mp_opt->sndr_key;
subflow->can_ack = 1;
Expand Down

0 comments on commit d6085fe

Please sign in to comment.