Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757714AbXEPJav (ORCPT ); Wed, 16 May 2007 05:30:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755432AbXEPJal (ORCPT ); Wed, 16 May 2007 05:30:41 -0400 Received: from twin.jikos.cz ([213.151.79.26]:34294 "EHLO twin.jikos.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752203AbXEPJak (ORCPT ); Wed, 16 May 2007 05:30:40 -0400 Date: Wed, 16 May 2007 11:29:45 +0200 (CEST) From: Jiri Kosina To: Satyam Sharma cc: Marcel Holtmann , Greg KH , Jeremy Fitzhardinge , maxk@qualcomm.com, bluez-devel@lists.sourceforge.net, Cedric Le Goater , Linux Kernel Mailing List , netdev@vger.kernel.org Subject: Re: 2.6.21-rc7: BUG: sleeping function called from invalid context at net/core/sock.c:1523 In-Reply-To: Message-ID: References: <462D1B09.9050005@goop.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 954 Lines: 30 On Fri, 11 May 2007, Satyam Sharma wrote: > (later) > I Googled a bit to see if this problem was faced elsewhere in the kernel > too. Saw the following commit by Ingo Molnar > (9883a13c72dbf8c518814b6091019643cdb34429): > - lock_sock(sock->sk); > + local_bh_disable(); > + bh_lock_sock_nested(sock->sk); > rc = selinux_netlbl_socket_setsid(sock, sksec->sid); > - release_sock(sock->sk); > + bh_unlock_sock(sock->sk); > + local_bh_enable(); > Is it _really_ *this* simple? Hi Satyam, actually this *seems* to be proper solution also for our case, thanks for pointing this out. I will think about it once again, do some more tests with this locking scheme, and will let you know. Thanks, -- Jiri Kosina - 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/