Re: [PATCH net v2] net: mptcp: fix unreleased socket in accept queue

From: kernel test robot
Date: Wed Sep 07 2022 - 05:37:20 EST


Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net/master]

url: https://github.com/intel-lab-lkp/linux/commits/menglong8-dong-gmail-com/net-mptcp-fix-unreleased-socket-in-accept-queue/20220907-163559
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git e1091e226a2bab4ded1fe26efba2aee1aab06450
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20220907/202209071742.Cv2hLTkj-lkp@xxxxxxxxx/config)
compiler: hppa-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/d238db12dcac26bfb2197e0aae24fadf6bbfdcb6
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review menglong8-dong-gmail-com/net-mptcp-fix-unreleased-socket-in-accept-queue/20220907-163559
git checkout d238db12dcac26bfb2197e0aae24fadf6bbfdcb6
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash net/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> net/mptcp/protocol.c:2799:6: warning: no previous prototype for 'mptcp_close_nolock' [-Wmissing-prototypes]
2799 | void mptcp_close_nolock(struct sock *sk, long timeout)
| ^~~~~~~~~~~~~~~~~~


vim +/mptcp_close_nolock +2799 net/mptcp/protocol.c

2798
> 2799 void mptcp_close_nolock(struct sock *sk, long timeout)
2800 {
2801 struct mptcp_subflow_context *subflow;
2802 struct mptcp_sock *msk = mptcp_sk(sk);
2803 bool do_cancel_work = false;
2804
2805 sk->sk_shutdown = SHUTDOWN_MASK;
2806
2807 if ((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) {
2808 inet_sk_state_store(sk, TCP_CLOSE);
2809 goto cleanup;
2810 }
2811
2812 if (mptcp_close_state(sk))
2813 __mptcp_wr_shutdown(sk);
2814
2815 sk_stream_wait_close(sk, timeout);
2816
2817 cleanup:
2818 /* orphan all the subflows */
2819 inet_csk(sk)->icsk_mtup.probe_timestamp = tcp_jiffies32;
2820 mptcp_for_each_subflow(msk, subflow) {
2821 struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
2822 bool slow = lock_sock_fast_nested(ssk);
2823
2824 /* since the close timeout takes precedence on the fail one,
2825 * cancel the latter
2826 */
2827 if (ssk == msk->first)
2828 subflow->fail_tout = 0;
2829
2830 sock_orphan(ssk);
2831 unlock_sock_fast(ssk, slow);
2832 }
2833 sock_orphan(sk);
2834
2835 pr_debug("msk=%p state=%d", sk, sk->sk_state);
2836 if (mptcp_sk(sk)->token)
2837 mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL);
2838
2839 if (sk->sk_state == TCP_CLOSE) {
2840 __mptcp_destroy_sock(sk);
2841 do_cancel_work = true;
2842 } else {
2843 mptcp_reset_timeout(msk, 0);
2844 }
2845
2846 if (do_cancel_work)
2847 mptcp_cancel_work(sk);
2848 }
2849

--
0-DAY CI Kernel Test Service
https://01.org/lkp