]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: Check for orphaned subflow before handling MP_FAIL timer
authorMat Martineau <mathew.j.martineau@linux.intel.com>
Wed, 18 May 2022 22:04:44 +0000 (15:04 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 20 May 2022 03:05:07 +0000 (20:05 -0700)
commit2a9cce2cef9a8049cc3d8dbdef92a14a424999a0
treed78e18e690a92b61a557f4a0cea1fb2cffd56820
parentb14b1eb884f45fb031e60a708715471ba3c0a850
mptcp: Check for orphaned subflow before handling MP_FAIL timer

MP_FAIL timeout (waiting for a peer to respond to an MP_FAIL with
another MP_FAIL) is implemented using the MPTCP socket's sk_timer. That
timer is also used at MPTCP socket close, so it's important to not have
the two timer users interfere with each other.

At MPTCP socket close, all subflows are orphaned before sk_timer is
manipulated. By checking the SOCK_DEAD flag on the subflows, each
subflow can determine if the timer is safe to alter without acquiring
any MPTCP-level lock. This replaces code that was using the
mptcp_data_lock and MPTCP-level socket state checks that did not
correctly protect the timer.

Fixes: f1398993853c ("mptcp: reset subflow when MP_FAIL doesn't respond")
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/pm.c
net/mptcp/subflow.c