Commit 56a666c
mptcp: fix possible list corruption on passive MPJ
At passive MPJ time, if the msk socket lock is held by the user,
the new subflow is appended to the msk->join_list under the msk
data lock.
In mptcp_release_cb()/__mptcp_flush_join_list(), the subflows in
that list are moved from the join_list into the conn_list under the
msk socket lock.
Append and removal could race, possibly corrupting such list.
Address the issue splicing the join list into a temporary one while
still under the msk data lock.
Found by code inspection, the race itself should be almost impossible
to trigger in practice.
Fixes: 3e50149 ("mptcp: cleanup MPJ subflow list handling")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 0ad529d commit 56a666c
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
853 | | - | |
| 853 | + | |
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
858 | | - | |
| 858 | + | |
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
| |||
3342 | 3342 | | |
3343 | 3343 | | |
3344 | 3344 | | |
| 3345 | + | |
| 3346 | + | |
3345 | 3347 | | |
3346 | 3348 | | |
3347 | 3349 | | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
3348 | 3353 | | |
3349 | 3354 | | |
3350 | 3355 | | |
| |||
3355 | 3360 | | |
3356 | 3361 | | |
3357 | 3362 | | |
| 3363 | + | |
3358 | 3364 | | |
3359 | | - | |
| 3365 | + | |
3360 | 3366 | | |
3361 | 3367 | | |
3362 | 3368 | | |
| |||
0 commit comments