Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
mptcp: Properly reset sockets in tcp_disconnect
Browse files Browse the repository at this point in the history
It is possible that we end up in tcp_disconnect after a failed call to
connect(). In that case tp->request_mptcp is set. We correctly remove
the socket from the token hash-table but leave request_mptcp set. This
can lead to inconsistent states later on if for some reason we end up
disabling MPTCP on that disconnected socket.

Fixes: Zero-day bug
Signed-off-by: Christoph Paasch <cpaasch@apple.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
(cherry picked from commit f4596c1)
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
(cherry picked from commit 7700fc3)
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
  • Loading branch information
cpaasch authored and matttbe committed Feb 28, 2022
1 parent 0052fdb commit cdd6ff9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2683,6 +2683,7 @@ int tcp_disconnect(struct sock *sk, int flags)
if (is_meta_sk(sk)) {
mptcp_disconnect(sk);
} else {
tp->request_mptcp = 0;
if (tp->inside_tk_table)
mptcp_hash_remove_bh(tp);
}
Expand Down

0 comments on commit cdd6ff9

Please sign in to comment.