]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: remove redundant req destruct in subflow_check_req()
authorJianguo Wu <wujianguo@chinatelecom.cn>
Sat, 10 Jul 2021 00:20:47 +0000 (17:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Jul 2021 01:38:53 +0000 (18:38 -0700)
commit210d7db8e23658f83ee190ef90f172e91bcca42d
treecb98cd26b301fa768e7db75852af276457da4cca
parent10d7f562cd25d8e8af99f06dc40a6f905d7adc11
mptcp: remove redundant req destruct in subflow_check_req()

In subflow_check_req(), if subflow sport is mismatch, will put msk,
destroy token, and destruct req, then return -EPERM, which can be
done by subflow_req_destructor() via:

  tcp_conn_request()
    |--__reqsk_free()
      |--subflow_req_destructor()

So we should remove these redundant code, otherwise will call
tcp_v4_reqsk_destructor() twice, and may double free
inet_rsk(req)->ireq_opt.

Fixes: eb50aad4b1db ("mptcp: add port number check for MP_JOIN")
Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/subflow.c