From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7277126842857766265==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH] ipv4: fix lock leaks Date: Fri, 21 Jan 2022 17:30:20 +0800 Message-ID: <202201211725.MInieseL-lkp@intel.com> In-Reply-To: <20220121031108.4813-1-ycaibb@gmail.com> List-Id: --===============7277126842857766265== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: um-i386_defconfig (https://download.01.org/0day-ci/archive/20220121= /202201211725.MInieseL-lkp(a)intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=3D1 build): # https://github.com/0day-ci/linux/commit/604258c8f5a9792828f54e557= 69ca1673c4a34ee git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review ycaibb/ipv4-fix-lock-leaks/2022012= 1-111241 git checkout 604258c8f5a9792828f54e55769ca1673c4a34ee # save the config file to linux build tree mkdir build_dir make W=3D1 O=3Dbuild_dir ARCH=3Dum SUBARCH=3Di386 SHELL=3D/bin/bash= net/ipv4/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): net/ipv4/tcp_ipv4.c: In function 'listening_get_first': >> net/ipv4/tcp_ipv4.c:2342:4: warning: this 'if' clause does not guard... = [-Wmisleading-indentation] 2342 | if (seq_sk_match(seq, sk)) | ^~ net/ipv4/tcp_ipv4.c:2344:5: note: ...this statement, but the latter is m= isleadingly indented as if it were guarded by the 'if' 2344 | return sk; | ^~~~~~ net/ipv4/tcp_ipv4.c: In function 'established_get_first': net/ipv4/tcp_ipv4.c:2421:4: warning: this 'if' clause does not guard... = [-Wmisleading-indentation] 2421 | if (seq_sk_match(seq, sk)) | ^~ net/ipv4/tcp_ipv4.c:2423:5: note: ...this statement, but the latter is m= isleadingly indented as if it were guarded by the 'if' 2423 | return sk; | ^~~~~~ vim +/if +2342 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 bucke= t (starting from st->bucket) b72acf4501d7c3 Martin KaFai Lau 2021-07-01 2323 * and return the first s= k from it. a8b690f98baf9f Tom Herbert 2010-06-07 2324 */ b72acf4501d7c3 Martin KaFai Lau 2021-07-01 2325 static void *listening_ge= t_first(struct seq_file *seq) ^1da177e4c3f41 Linus Torvalds 2005-04-16 2326 { ^1da177e4c3f41 Linus Torvalds 2005-04-16 2327 struct tcp_iter_state *s= t =3D seq->private; b08d4d3b6c0460 Yonghong Song 2020-06-23 2328 = a8b690f98baf9f Tom Herbert 2010-06-07 2329 st->offset =3D 0; 05c0b35709c58b Martin KaFai Lau 2021-07-01 2330 for (; st->bucket <=3D t= cp_hashinfo.lhash2_mask; st->bucket++) { 05c0b35709c58b Martin KaFai Lau 2021-07-01 2331 struct inet_listen_hash= bucket *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 =3D &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_ic= sk(icsk, &ilb2->head) { 05c0b35709c58b Martin KaFai Lau 2021-07-01 2341 sk =3D (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->lo= ck); 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 --===============7277126842857766265==--