This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mptcp: fix master unlock race in mptcp_disconnect
When creating an actual mptcp socket out of a request, a call to mptcp_create_master_sk() creates a master socket which is locked and needs to be unlocked in all (error) paths. Commit 79d7578 ("mptcp: Fix error-cases in TCP_SYNCOOKIES path") tries to address this by blindly unlocking any locked subflows in mptcp_disconnect, but this can lead to races with other CPUs that may also have taken the lock on this socket. Our internal test suite occasionally pops a warning that indicates that this happens, although very rarely. This modification removes this scary unlock. Commit 79d7578 ("mptcp: Fix error-cases in TCP_SYNCOOKIES path") only mentions the path coming from TCP_SYNCOOKIES, but in reality there are other paths that can trigger the error and subsequent unlock in mptcp_disconnect() through tcp_conn_request(), tcp_check_req() and mptcp_check_req_master(). Only the path in tcp_conn_request() needs to be adapted after having changed inet_csk_reqsk_queue_add(). Fixes: 79d7578 ("mptcp: Fix error-cases in TCP_SYNCOOKIES path") Signed-off-by: Tim Froidcoeur <[email protected]> Acked-by: Christoph Paasch <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]>
- Loading branch information