]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: Do not traverse the subflow connection list without lock
authorMat Martineau <mathew.j.martineau@linux.intel.com>
Wed, 18 May 2022 22:04:45 +0000 (15:04 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 20 May 2022 03:05:07 +0000 (20:05 -0700)
commit4c1151575c24328ff9564732ad20234fe17be59d
tree9a5899c760f46b2a47edc093c5e01c07841e4a3e
parent2a9cce2cef9a8049cc3d8dbdef92a14a424999a0
mptcp: Do not traverse the subflow connection list without lock

The MPTCP socket's conn_list (list of subflows) requires the socket lock
to access. The MP_FAIL timeout code added such an access, where it would
check the list of subflows both in timer context and (later) in workqueue
context where the socket lock is held.

Rather than check the list twice, remove the check in the timeout
handler and only depend on the check in the workqueue. Also remove the
MPTCP_FAIL_NO_RESPONSE flag, since mptcp_mp_fail_no_response() has
insignificant overhead and can be checked on each worker run.

Fixes: f1398993853c ("mptcp: reset subflow when MP_FAIL doesn't respond")
Reported-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c
net/mptcp/protocol.h