netdev
[Top] [All Lists]

Re: assertion (!atomic_read(&sk->sk_rmem_alloc)) failed at net/netlink/a

To: Ken-ichirou MATSUZAWA <chamas@xxxxxxxxxxxxx>
Subject: Re: assertion (!atomic_read(&sk->sk_rmem_alloc)) failed at net/netlink/af_netlink.c (122)
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 11 May 2005 10:58:36 +1000
Cc: netdev@xxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxxxxx>
In-reply-to: <20050510220751.GA459@xxxxxxxxxxxxxxxxxxx>
References: <20050510.214332.-1300551106.chamas@xxxxxxxxxxxxx> <20050510220751.GA459@xxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
On Wed, May 11, 2005 at 08:07:51AM +1000, herbert wrote:
> On Tue, May 10, 2005 at 12:43:32PM +0000, Ken-ichirou MATSUZAWA wrote:
> > 
> > Everytime on shutting down, the subject message is logged.  
> > It seems that the reason is do_one_broadcast may preempt
> > netlink_recvmsg. Added patch to 2.6.12-rc4 seems resolving this
> > problem.
> 
> Thanks for the patch.  To help me understand the problem better,
> could you please tell me:

I think I understand your patch now.  What's happening is that

1) The skb is sent to socket 1.
2) Someone does a recvmsg on socket 1 and drops the ref on the skb.
   Note that the rmalloc is not returned at this point since the
   skb is still referenced.
3) The same skb is now sent to socket 2.

I agree with your solution except that we should still do the skb_get
if we can.  Here is my version where we only do the skb_get at the
start.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Please let me know whether this works for you or not.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Attachment: p
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>