All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: ycaibb <ycaibb@gmail.com>,
	edumazet@google.com, davem@davemloft.net,
	yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org,
	ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	kafai@fb.com, songliubraving@fb.com
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [PATCH] ipv4: fix lock leaks
Date: Fri, 21 Jan 2022 15:58:10 +0800	[thread overview]
Message-ID: <202201211532.LRhcv7cH-lkp@intel.com> (raw)
In-Reply-To: <20220121031108.4813-1-ycaibb@gmail.com>

Hi ycaibb,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]
[also build test WARNING on net/master horms-ipvs/master linus/master v5.16 next-20220121]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/ycaibb/ipv4-fix-lock-leaks/20220121-111241
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 8aaaf2f3af2ae212428f4db1af34214225f5cec3
config: mips-cu1000-neo_defconfig (https://download.01.org/0day-ci/archive/20220121/202201211532.LRhcv7cH-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d4baf3b1322b84816aa623d8e8cb45a49cb68b84)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://github.com/0day-ci/linux/commit/604258c8f5a9792828f54e55769ca1673c4a34ee
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review ycaibb/ipv4-fix-lock-leaks/20220121-111241
        git checkout 604258c8f5a9792828f54e55769ca1673c4a34ee
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash net/ipv4/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> net/ipv4/tcp_ipv4.c:2344:5: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
                                   return sk;
                                   ^
   net/ipv4/tcp_ipv4.c:2342:4: note: previous statement is here
                           if (seq_sk_match(seq, sk))
                           ^
   net/ipv4/tcp_ipv4.c:2423:5: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
                                   return sk;
                                   ^
   net/ipv4/tcp_ipv4.c:2421:4: note: previous statement is here
                           if (seq_sk_match(seq, sk))
                           ^
   2 warnings generated.


vim +/if +2344 net/ipv4/tcp_ipv4.c

ad2d61376a0517 Martin KaFai Lau 2021-07-01  2321  
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2322  /* Find a non empty bucket (starting from st->bucket)
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2323   * and return the first sk from it.
a8b690f98baf9f Tom Herbert      2010-06-07  2324   */
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2325  static void *listening_get_first(struct seq_file *seq)
^1da177e4c3f41 Linus Torvalds   2005-04-16  2326  {
^1da177e4c3f41 Linus Torvalds   2005-04-16  2327  	struct tcp_iter_state *st = seq->private;
b08d4d3b6c0460 Yonghong Song    2020-06-23  2328  
a8b690f98baf9f Tom Herbert      2010-06-07  2329  	st->offset = 0;
05c0b35709c58b Martin KaFai Lau 2021-07-01  2330  	for (; st->bucket <= tcp_hashinfo.lhash2_mask; st->bucket++) {
05c0b35709c58b Martin KaFai Lau 2021-07-01  2331  		struct inet_listen_hashbucket *ilb2;
05c0b35709c58b Martin KaFai Lau 2021-07-01  2332  		struct inet_connection_sock *icsk;
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2333  		struct sock *sk;
^1da177e4c3f41 Linus Torvalds   2005-04-16  2334  
05c0b35709c58b Martin KaFai Lau 2021-07-01  2335  		ilb2 = &tcp_hashinfo.lhash2[st->bucket];
05c0b35709c58b Martin KaFai Lau 2021-07-01  2336  		if (hlist_empty(&ilb2->head))
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2337  			continue;
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2338  
05c0b35709c58b Martin KaFai Lau 2021-07-01  2339  		spin_lock(&ilb2->lock);
05c0b35709c58b Martin KaFai Lau 2021-07-01  2340  		inet_lhash2_for_each_icsk(icsk, &ilb2->head) {
05c0b35709c58b Martin KaFai Lau 2021-07-01  2341  			sk = (struct sock *)icsk;
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2342  			if (seq_sk_match(seq, sk))
604258c8f5a979 Ryan Cai         2022-01-21  2343  				spin_unlock(&ilb2->lock);
b72acf4501d7c3 Martin KaFai Lau 2021-07-01 @2344  				return sk;
^1da177e4c3f41 Linus Torvalds   2005-04-16  2345  		}
05c0b35709c58b Martin KaFai Lau 2021-07-01  2346  		spin_unlock(&ilb2->lock);
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2347  	}
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2348  
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2349  	return NULL;
^1da177e4c3f41 Linus Torvalds   2005-04-16  2350  }
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2351  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] ipv4: fix lock leaks
Date: Fri, 21 Jan 2022 15:58:10 +0800	[thread overview]
Message-ID: <202201211532.LRhcv7cH-lkp@intel.com> (raw)
In-Reply-To: <20220121031108.4813-1-ycaibb@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5008 bytes --]

Hi ycaibb,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]
[also build test WARNING on net/master horms-ipvs/master linus/master v5.16 next-20220121]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/ycaibb/ipv4-fix-lock-leaks/20220121-111241
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 8aaaf2f3af2ae212428f4db1af34214225f5cec3
config: mips-cu1000-neo_defconfig (https://download.01.org/0day-ci/archive/20220121/202201211532.LRhcv7cH-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d4baf3b1322b84816aa623d8e8cb45a49cb68b84)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://github.com/0day-ci/linux/commit/604258c8f5a9792828f54e55769ca1673c4a34ee
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review ycaibb/ipv4-fix-lock-leaks/20220121-111241
        git checkout 604258c8f5a9792828f54e55769ca1673c4a34ee
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash net/ipv4/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> net/ipv4/tcp_ipv4.c:2344:5: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
                                   return sk;
                                   ^
   net/ipv4/tcp_ipv4.c:2342:4: note: previous statement is here
                           if (seq_sk_match(seq, sk))
                           ^
   net/ipv4/tcp_ipv4.c:2423:5: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
                                   return sk;
                                   ^
   net/ipv4/tcp_ipv4.c:2421:4: note: previous statement is here
                           if (seq_sk_match(seq, sk))
                           ^
   2 warnings generated.


vim +/if +2344 net/ipv4/tcp_ipv4.c

ad2d61376a0517 Martin KaFai Lau 2021-07-01  2321  
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2322  /* Find a non empty bucket (starting from st->bucket)
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2323   * and return the first sk from it.
a8b690f98baf9f Tom Herbert      2010-06-07  2324   */
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2325  static void *listening_get_first(struct seq_file *seq)
^1da177e4c3f41 Linus Torvalds   2005-04-16  2326  {
^1da177e4c3f41 Linus Torvalds   2005-04-16  2327  	struct tcp_iter_state *st = seq->private;
b08d4d3b6c0460 Yonghong Song    2020-06-23  2328  
a8b690f98baf9f Tom Herbert      2010-06-07  2329  	st->offset = 0;
05c0b35709c58b Martin KaFai Lau 2021-07-01  2330  	for (; st->bucket <= tcp_hashinfo.lhash2_mask; st->bucket++) {
05c0b35709c58b Martin KaFai Lau 2021-07-01  2331  		struct inet_listen_hashbucket *ilb2;
05c0b35709c58b Martin KaFai Lau 2021-07-01  2332  		struct inet_connection_sock *icsk;
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2333  		struct sock *sk;
^1da177e4c3f41 Linus Torvalds   2005-04-16  2334  
05c0b35709c58b Martin KaFai Lau 2021-07-01  2335  		ilb2 = &tcp_hashinfo.lhash2[st->bucket];
05c0b35709c58b Martin KaFai Lau 2021-07-01  2336  		if (hlist_empty(&ilb2->head))
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2337  			continue;
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2338  
05c0b35709c58b Martin KaFai Lau 2021-07-01  2339  		spin_lock(&ilb2->lock);
05c0b35709c58b Martin KaFai Lau 2021-07-01  2340  		inet_lhash2_for_each_icsk(icsk, &ilb2->head) {
05c0b35709c58b Martin KaFai Lau 2021-07-01  2341  			sk = (struct sock *)icsk;
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2342  			if (seq_sk_match(seq, sk))
604258c8f5a979 Ryan Cai         2022-01-21  2343  				spin_unlock(&ilb2->lock);
b72acf4501d7c3 Martin KaFai Lau 2021-07-01 @2344  				return sk;
^1da177e4c3f41 Linus Torvalds   2005-04-16  2345  		}
05c0b35709c58b Martin KaFai Lau 2021-07-01  2346  		spin_unlock(&ilb2->lock);
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2347  	}
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2348  
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2349  	return NULL;
^1da177e4c3f41 Linus Torvalds   2005-04-16  2350  }
b72acf4501d7c3 Martin KaFai Lau 2021-07-01  2351  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

  parent reply	other threads:[~2022-01-21  7:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21  3:11 [PATCH] ipv4: fix lock leaks ycaibb
2022-01-21  3:46 ` Jakub Kicinski
2022-01-21  3:47 ` Jakub Kicinski
2022-01-21  4:06   ` Ryan Cai
2022-01-21  4:11     ` Alexei Starovoitov
2022-01-21  7:58 ` kernel test robot [this message]
2022-01-21  7:58   ` kernel test robot
2022-01-21  9:30 ` kernel test robot
2022-01-21  9:30 ` kernel test robot
2022-01-23  6:17 ` [ipv4] 604258c8f5: BUG:sleeping_function_called_from_invalid_context_at_lib/iov_iter.c kernel test robot
2022-01-23  6:17   ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-01-21 22:57 [PATCH] ipv4: fix lock leaks kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202201211532.LRhcv7cH-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kafai@fb.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=songliubraving@fb.com \
    --cc=ycaibb@gmail.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.