]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: free resources when the port number is mismatched
authorGeliang Tang <geliangtang@gmail.com>
Thu, 4 Mar 2021 21:32:16 +0000 (13:32 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Mar 2021 22:30:13 +0000 (14:30 -0800)
commitca5e6696732f5826d16c229ec04010626523091a
tree6a3340a36ed349a0e61c5a25fd2ba2afff4ac551
parentce2e1e430437dd7d6ce58ad41badfe46ab8f6a23
mptcp: free resources when the port number is mismatched

When the port number is mismatched with the announced ones, use
'goto dispose_child' to free the resources instead of using 'goto out'.

This patch also moves the port number checking code in
subflow_syn_recv_sock before mptcp_finish_join, otherwise subflow_drop_ctx
will fail in dispose_child.

Fixes: c7e771567d7b ("mptcp: add port number check for MP_JOIN")
Reported-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <geliangtang@gmail.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