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: Do not race forced-closure with packet reception
It is possible that we call inet_csk_prepare_forced_close() - which calls bh_unlock_sock() - on a socket that is already in the ehash table because it went through tcp_v4_syn_recv_sock. That is a problem. Because, the moment we unlock incoming packets may be processed on the socket, because this socket has not the mpc-flag set. So, that means that we are processing an incoming packet while at the same time being potentially inside tcp_done(). Only bad things can happen there... I'm hunting down a weird kernel-WARNING in __inet_hash_connect() and the current best guess is that this is the problem, as it can cause all kind of racy behavior. [858163.658887] ------------[ cut here ]------------ [858163.661126] WARNING: CPU: 24 PID: 7966 at net/ipv4/inet_hashtables.c:740 __inet_hash_connect+0x419/0x440 [...] Fixes: 1f2d951 ("Fix error-handling") Signed-off-by: Christoph Paasch <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> (cherry picked from commit 1d5fc78) Signed-off-by: Matthieu Baerts <[email protected]> (cherry picked from commit fe3634a) Signed-off-by: Matthieu Baerts <[email protected]>
- Loading branch information