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 unlocking-check on wrong socket
syzkaller found its way into triggering inet_csk_reqsk_queue_add() with a listener that is no more listening. In that case we unlock the master-socket to avoid having to do the unlock-magic in mptcp_disconnect(), that we removed with commit b39aafe ("mptcp: fix master unlock race in mptcp_disconnect"). A typo found its way into the code though. We need to check the child-socket, not the sk-socket. Also, we need to make sure this actually is a TCP-socket. Because inet_csk_reqsk_queue_add can be called from DCCP. That caused us to never unlock the master-socket. Adding a BUG_ON() as well, as it helped tremenduosly to debug this case as otherwise any bugs happen much later. Cc: Tim Froidcoeur <[email protected]> Fixes: b39aafe ("mptcp: fix master unlock race in mptcp_disconnect") Signed-off-by: Christoph Paasch <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> (cherry picked from commit cb954b5) Signed-off-by: Matthieu Baerts <[email protected]> (cherry picked from commit 3fdb0ed) Signed-off-by: Matthieu Baerts <[email protected]> (cherry picked from commit 8cb79b5) Signed-off-by: Matthieu Baerts <[email protected]>
- Loading branch information