Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759197AbXEQFvv (ORCPT ); Thu, 17 May 2007 01:51:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757072AbXEQFvo (ORCPT ); Thu, 17 May 2007 01:51:44 -0400 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:33695 "EHLO sunset.davemloft.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1756866AbXEQFvo (ORCPT ); Thu, 17 May 2007 01:51:44 -0400 Date: Wed, 16 May 2007 22:51:29 -0700 (PDT) Message-Id: <20070516.225129.74748893.davem@davemloft.net> To: ssatyam@cse.iitk.ac.in Cc: akpm@linux-foundation.org, marcel@holtmann.org, jikos@jikos.cz, gregkh@suse.de, jeremy@goop.org, maxk@qualcomm.com, clg@fr.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bluetooth: fix locking in hci_sock_dev_event() From: David Miller In-Reply-To: References: X-Mailer: Mew version 5.1.52 on Emacs 21.4 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1246 Lines: 29 From: Satyam Sharma Date: Thu, 17 May 2007 11:13:36 +0530 (IST) > [PATCH] bluetooth: fix locking in hci_sock_dev_event() > > We presently use lock_sock() to acquire a lock on a socket in > hci_sock_dev_event(), but this goes BUG because lock_sock() > can sleep and we're already holding a read-write spinlock at > that point. So, we must use the non-sleeping BH version, > bh_lock_sock(). > > However, hci_sock_dev_event() is called from user context and > hence using simply bh_lock_sock() will deadlock against a > concurrent softirq that tries to acquire a lock on the same > socket. Hence, disabling BH's before acquiring the socket lock > and enable them afterwards, is the proper solution to fix > socket locking in hci_sock_dev_event(). > > Cc: David Miller > Signed-off-by: Satyam Sharma > Signed-off-by: Marcel Holtmann > Signed-off-by: Jiri Kosina Thanks I'll merge this in. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/