All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH v2] tcp: fix race condition when creating child sockets from syncookies
Date: Wed, 11 Nov 2020 14:57:25 +0800	[thread overview]
Message-ID: <202011111422.iuTXe7Vb-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20201109161146.GA629827@rdias-suse-pc.lan>
References: <20201109161146.GA629827@rdias-suse-pc.lan>
TO: Ricardo Dias <rdias@singlestore.com>
TO: davem(a)davemloft.net
TO: kuba(a)kernel.org
TO: kuznet(a)ms2.inr.ac.ru
TO: yoshfuji(a)linux-ipv6.org
TO: edumazet(a)google.com
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

Hi Ricardo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]
[also build test WARNING on net/master linus/master sparc-next/master v5.10-rc3 next-20201110]
[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/Ricardo-Dias/tcp-fix-race-condition-when-creating-child-sockets-from-syncookies/20201110-001214
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git bff6f1db91e330d7fba56f815cdbc412c75fe163
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: riscv-randconfig-s031-20201109 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-106-gd020cf33-dirty
        # https://github.com/0day-ci/linux/commit/52d4b7238a3e63643168c08c1496e59c41d33091
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ricardo-Dias/tcp-fix-race-condition-when-creating-child-sockets-from-syncookies/20201110-001214
        git checkout 52d4b7238a3e63643168c08c1496e59c41d33091
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=riscv 

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


"sparse warnings: (new ones prefixed by >>)"
   net/ipv4/tcp_ipv4.c:2802:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *data @@     got struct tcp_congestion_ops const [noderef] __rcu *tcp_congestion_control @@
   net/ipv4/tcp_ipv4.c:2802:41: sparse:     expected void const *data
   net/ipv4/tcp_ipv4.c:2802:41: sparse:     got struct tcp_congestion_ops const [noderef] __rcu *tcp_congestion_control
   net/ipv4/tcp_ipv4.c:2911:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *data @@     got struct tcp_congestion_ops const [noderef] __rcu *extern [addressable] [toplevel] tcp_congestion_control @@
   net/ipv4/tcp_ipv4.c:2911:45: sparse:     expected void const *data
   net/ipv4/tcp_ipv4.c:2911:45: sparse:     got struct tcp_congestion_ops const [noderef] __rcu *extern [addressable] [toplevel] tcp_congestion_control
   net/ipv4/tcp_ipv4.c:2915:50: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct tcp_congestion_ops const [noderef] __rcu *tcp_congestion_control @@     got struct tcp_congestion_ops * @@
   net/ipv4/tcp_ipv4.c:2915:50: sparse:     expected struct tcp_congestion_ops const [noderef] __rcu *tcp_congestion_control
   net/ipv4/tcp_ipv4.c:2915:50: sparse:     got struct tcp_congestion_ops *
>> net/ipv4/tcp_ipv4.c:1589:25: sparse: sparse: context imbalance in 'tcp_v4_syn_recv_sock' - unexpected unlock
   net/ipv4/tcp_ipv4.c:1858:17: sparse: sparse: context imbalance in 'tcp_add_backlog' - unexpected unlock
   net/ipv4/tcp_ipv4.c:2081:21: sparse: sparse: context imbalance in 'tcp_v4_rcv' - different lock contexts for basic block
   net/ipv4/tcp_ipv4.c:2276:20: sparse: sparse: context imbalance in 'listening_get_next' - unexpected unlock
   net/ipv4/tcp_ipv4.c:2343:9: sparse: sparse: context imbalance in 'established_get_first' - wrong count at exit
   net/ipv4/tcp_ipv4.c:2371:40: sparse: sparse: context imbalance in 'established_get_next' - unexpected unlock
   net/ipv4/tcp_ipv4.c:2501:36: sparse: sparse: context imbalance in 'tcp_seq_stop' - unexpected unlock
   net/ipv4/tcp_ipv4.c:2803:41: sparse: sparse: dereference of noderef expression
   net/ipv4/tcp_ipv4.c:2803:41: sparse: sparse: dereference of noderef expression
   net/ipv4/tcp_ipv4.c:2912:45: sparse: sparse: dereference of noderef expression
   net/ipv4/tcp_ipv4.c:2912:45: sparse: sparse: dereference of noderef expression
--
>> net/ipv6/tcp_ipv6.c:1399:25: sparse: sparse: context imbalance in 'tcp_v6_syn_recv_sock' - unexpected unlock
   net/ipv6/tcp_ipv6.c:1742:21: sparse: sparse: context imbalance in 'tcp_v6_rcv' - different lock contexts for basic block

vim +/tcp_v4_syn_recv_sock +1589 net/ipv4/tcp_ipv4.c

cfb6eeb4c860592 YOSHIFUJI Hideaki 2006-11-14  1576  
0e734419923bd8e David S. Miller   2011-05-08  1577  	if (__inet_inherit_port(sk, newsk) < 0)
0e734419923bd8e David S. Miller   2011-05-08  1578  		goto put_and_exit;
52d4b7238a3e636 Ricardo Dias      2020-11-09  1579  	osk = req_to_sk(req_unhash);
52d4b7238a3e636 Ricardo Dias      2020-11-09  1580  	*own_req = inet_ehash_nolisten(newsk, &osk);
c92e8c02fe66415 Eric Dumazet      2017-10-20  1581  	if (likely(*own_req)) {
49a496c97d035f2 Eric Dumazet      2015-11-05  1582  		tcp_move_syn(newtp, req);
c92e8c02fe66415 Eric Dumazet      2017-10-20  1583  		ireq->ireq_opt = NULL;
c92e8c02fe66415 Eric Dumazet      2017-10-20  1584  	} else {
52d4b7238a3e636 Ricardo Dias      2020-11-09  1585  		if (!req_unhash && osk) {
52d4b7238a3e636 Ricardo Dias      2020-11-09  1586  			/* This code path should only be executed in the
52d4b7238a3e636 Ricardo Dias      2020-11-09  1587  			 * syncookie case only
52d4b7238a3e636 Ricardo Dias      2020-11-09  1588  			 */
52d4b7238a3e636 Ricardo Dias      2020-11-09 @1589  			bh_unlock_sock(newsk);
52d4b7238a3e636 Ricardo Dias      2020-11-09  1590  			sock_put(newsk);
52d4b7238a3e636 Ricardo Dias      2020-11-09  1591  			newsk = osk;
52d4b7238a3e636 Ricardo Dias      2020-11-09  1592  		}
c92e8c02fe66415 Eric Dumazet      2017-10-20  1593  		newinet->inet_opt = NULL;
c92e8c02fe66415 Eric Dumazet      2017-10-20  1594  	}
^1da177e4c3f415 Linus Torvalds    2005-04-16  1595  	return newsk;
^1da177e4c3f415 Linus Torvalds    2005-04-16  1596  
^1da177e4c3f415 Linus Torvalds    2005-04-16  1597  exit_overflow:
c10d9310edf5aa4 Eric Dumazet      2016-04-29  1598  	NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
093d282321daeb1 Balazs Scheidler  2010-10-21  1599  exit_nonewsk:
093d282321daeb1 Balazs Scheidler  2010-10-21  1600  	dst_release(dst);
^1da177e4c3f415 Linus Torvalds    2005-04-16  1601  exit:
9caad864151e525 Eric Dumazet      2016-04-01  1602  	tcp_listendrop(sk);
^1da177e4c3f415 Linus Torvalds    2005-04-16  1603  	return NULL;
0e734419923bd8e David S. Miller   2011-05-08  1604  put_and_exit:
c92e8c02fe66415 Eric Dumazet      2017-10-20  1605  	newinet->inet_opt = NULL;
e337e24d6624e74 Christoph Paasch  2012-12-14  1606  	inet_csk_prepare_forced_close(newsk);
e337e24d6624e74 Christoph Paasch  2012-12-14  1607  	tcp_done(newsk);
0e734419923bd8e David S. Miller   2011-05-08  1608  	goto exit;
^1da177e4c3f415 Linus Torvalds    2005-04-16  1609  }
4bc2f18ba4f22a9 Eric Dumazet      2010-07-09  1610  EXPORT_SYMBOL(tcp_v4_syn_recv_sock);
^1da177e4c3f415 Linus Torvalds    2005-04-16  1611  

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30064 bytes --]

             reply	other threads:[~2020-11-11  6:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11  6:57 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-11-10  6:58 [PATCH v2] tcp: fix race condition when creating child sockets from syncookies kernel test robot
2020-11-10  6:23 kernel test robot
2020-11-09 16:11 Ricardo Dias
2020-11-09 16:29 ` Eric Dumazet

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=202011111422.iuTXe7Vb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.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.