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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ada7idvfw0c.fsf@cisco.com>
Date:	Thu, 15 May 2008 08:05:23 -0700
From:	Roland Dreier <rdreier@...co.com>
To:	Johannes Berg <johannes@...solutions.net>
Cc:	linux-kernel@...r.kernel.org, linux-sparse@...r.kernel.org,
	David Brownell <david-b@...bell.net>
Subject: Re: Sparse annotation for "context imbalance" false positives?

 > You could, for example, insert this:
 > 
 > > 	static void mlx4_ib_lock_cqs(struct mlx4_ib_cq *send_cq, struct mlx4_ib_cq *recv_cq)
 > > 	{
 > > 		if (send_cq == recv_cq)
 > 		{
 > > 			spin_lock_irq(&send_cq->lock);
 > 			 /* pretend to have acquired both for sparse */	
 > 			__acquire(&recv_cq->lock);
 > 		}

but the problem sparse sees is not that some paths take only one lock
and some take two -- sparse is complaining that this function is
returning without unlocking the locks that it takes.  Even if I change
the function to something as simple as:

	static void mlx4_ib_lock_cqs(struct mlx4_ib_cq *send_cq, struct mlx4_ib_cq *recv_cq)
	{
		spin_lock_irq(&recv_cq->lock);
	}

I still get

    drivers/infiniband/hw/mlx4/qp.c:603:13: warning: context imbalance in 'mlx4_ib_lock_cqs' - wrong count at exitn

thanks,
  Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ