From patchwork Tue Jun 16 09:26:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ingo Molnar X-Patchwork-Id: 28725 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id C920CB7153 for ; Tue, 16 Jun 2009 19:27:04 +1000 (EST) Received: by ozlabs.org (Postfix) id BC595DDD1B; Tue, 16 Jun 2009 19:27:04 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 4F1BADDD04 for ; Tue, 16 Jun 2009 19:27:04 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755110AbZFPJ0l (ORCPT ); Tue, 16 Jun 2009 05:26:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752144AbZFPJ0l (ORCPT ); Tue, 16 Jun 2009 05:26:41 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:51788 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751831AbZFPJ0k (ORCPT ); Tue, 16 Jun 2009 05:26:40 -0400 Received: from elvis.elte.hu ([157.181.1.14]) by mx2.mail.elte.hu with esmtp (Exim) id 1MGUwA-0001ZV-Dk from ; Tue, 16 Jun 2009 11:26:40 +0200 Received: by elvis.elte.hu (Postfix, from userid 1004) id CADBE3E2151; Tue, 16 Jun 2009 11:26:33 +0200 (CEST) Date: Tue, 16 Jun 2009 11:26:35 +0200 From: Ingo Molnar To: David Miller Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [GIT]: Networking Message-ID: <20090616092635.GB4184@elte.hu> References: <20090615.050449.144947903.davem@davemloft.net> <20090616091538.GA4184@elte.hu> <20090616.022131.267374816.davem@davemloft.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090616.022131.267374816.davem@davemloft.net> User-Agent: Mutt/1.5.18 (2008-05-17) Received-SPF: neutral (mx2.mail.elte.hu: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu; X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org * David Miller wrote: > From: Ingo Molnar > Date: Tue, 16 Jun 2009 11:15:38 +0200 > > > BUG: sleeping function called from invalid context at net/core/sock.c:1851 > > This line in my tree (and Linus's) reads: > > if (sk->sk_lock.owned) > > what gives? :-) hmmm - i have to declare the small kmemcheck annotation attached below :-) (kmemcheck is off in the config so it shouldnt matter) So the line is: might_sleep(); Lemme dig. Ingo --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/core/sock.c b/net/core/sock.c index 06e26b7..b0ba569 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -945,6 +945,8 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, sk = kmalloc(prot->obj_size, priority); if (sk != NULL) { + kmemcheck_annotate_bitfield(sk, flags); + if (security_sk_alloc(sk, family, priority)) goto out_free;