lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 05 Oct 2015 09:27:49 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	kbuild test robot <fengguang.wu@...el.com>
Cc:	Eric Dumazet <edumazet@...gle.com>, kbuild-all@...org,
	netdev@...r.kernel.org
Subject: Re: [net-next:master 641/694] include/net/request_sock.h:198:9:
 sparse: context imbalance in 'tcp_conn_request' - unexpected unlock

On Tue, 2015-10-06 at 00:14 +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
> head:   4560cdff03a76348ee5fae48e3c7914e4de2db5b
> commit: 7656d842de93fd2d2de7b403062cad757cadf1df [641/694] tcp: fix fastopen races vs lockless listener
> reproduce:
>         # apt-get install sparse
>         git checkout 7656d842de93fd2d2de7b403062cad757cadf1df
>         make ARCH=x86_64 allmodconfig
>         make C=1 CF=-D__CHECK_ENDIAN__
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
> >> include/net/request_sock.h:198:9: sparse: context imbalance in 'tcp_conn_request' - unexpected unlock
> 
> vim +/tcp_conn_request +198 include/net/request_sock.h
> 
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  182  }
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  183  
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  184  static inline void reqsk_queue_add(struct request_sock_queue *queue,
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  185  				   struct request_sock *req,
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  186  				   struct sock *parent,
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  187  				   struct sock *child)
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  188  {
> fff1f300 Eric Dumazet             2015-10-02  189  	spin_lock(&queue->rskq_lock);
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  190  	req->sk = child;
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  191  	sk_acceptq_added(parent);
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  192  
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  193  	if (queue->rskq_accept_head == NULL)
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  194  		queue->rskq_accept_head = req;
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  195  	else
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  196  		queue->rskq_accept_tail->dl_next = req;
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  197  
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18 @198  	queue->rskq_accept_tail = req;
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  199  	req->dl_next = NULL;
> fff1f300 Eric Dumazet             2015-10-02  200  	spin_unlock(&queue->rskq_lock);
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  201  }
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  202  
> fff1f300 Eric Dumazet             2015-10-02  203  static inline struct request_sock *reqsk_queue_remove(struct request_sock_queue *queue,
> fff1f300 Eric Dumazet             2015-10-02  204  						      struct sock *parent)
> 0e87506f Arnaldo Carvalho de Melo 2005-06-18  205  {
> fff1f300 Eric Dumazet             2015-10-02  206  	struct request_sock *req;

Seems a false positive, or a rather useless message ?

I do not see any obvious problem in this code.

static inline void reqsk_queue_add(struct request_sock_queue *queue,
                                   struct request_sock *req,
                                   struct sock *parent,
                                   struct sock *child)
{
        spin_lock(&queue->rskq_lock);
	...
        spin_unlock(&queue->rskq_lock);
}

Thanks.



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ