]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: init mptcp request socket earlier
authorPaolo Abeni <pabeni@redhat.com>
Thu, 11 Feb 2021 23:30:40 +0000 (15:30 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Feb 2021 02:30:54 +0000 (18:30 -0800)
commitd7425bed89049603f87823b20598e4a8f47872de
treebb3711dda70f4a308641ae71bae513a5482ed51d
parent5583a70996e25e7d76f5e28b554e582c6eee89a0
mptcp: init mptcp request socket earlier

The mptcp subflow route_req() callback performs the subflow
req initialization after the route_req() check. If the latter
fails, mptcp-specific bits of the current request sockets
are left uninitialized.

The above causes bad things at req socket disposal time, when
the mptcp resources are cleared.

This change addresses the issue by splitting subflow_init_req()
into the actual initialization and the mptcp-specific checks.
The initialization is moved before any possibly failing check.

Reported-by: Christoph Paasch <cpaasch@apple.com>
Fixes: 4b385202e4f2 ("tcp: merge 'init_req' and 'route_req' functions")
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/subflow.c