mptcp: fix subflow traversal at disconnect time
authorPaolo Abeni <pabeni@redhat.com>
Fri, 8 Jul 2022 23:36:09 +0000 (16:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Jul 2022 10:31:38 +0000 (11:31 +0100)
commit5c835bb142d4013c2ab24bff5ae9f6709a39cbcf
tree7213de53b91b9a42654da4d4988ed6d1676c3be2
parent72a0b329114b1caa8e69dfa7cdad1dd3c69b8602
mptcp: fix subflow traversal at disconnect time

At disconnect time the MPTCP protocol traverse the subflows
list closing each of them. In some circumstances - MPJ subflow,
passive MPTCP socket, the latter operation can remove the
subflow from the list, invalidating the current iterator.

Address the issue using the safe list traversing helper
variant.

Reported-by: van fantasy <g1042620637@gmail.com>
Fixes: b29fcfb54cd7 ("mptcp: full disconnect implementation")
Tested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c