[Top] [All Lists]

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

To: "David S. Miller" <davem@xxxxxxxxxxxxx>
Subject: Re: KERNEL: assertion (!atomic_read(&sk->sk_rmem_alloc)) failed at net/netlink/af_netlink.c (126)
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 1 Apr 2005 09:23:22 +1000
Cc: mingo@xxxxxxx, netdev@xxxxxxxxxxx, linux-net@xxxxxxxxxxxxxxx, olel@xxxxxx
In-reply-to: <20050331231922.GA26587@xxxxxxxxxxxxxxxxxxx>
References: <20050327091524.GA23215@xxxxxxx> <E1DFUaZ-0001Hg-00@xxxxxxxxxxxxxxxxxxxxxxxx> <20050327133811.GA5569@xxxxxxx> <20050329104906.GA19836@xxxxxxxxxxxxxxxxxxx> <20050329114926.GA14986@xxxxxxx> <20050330082640.GA8269@xxxxxxxxxxxxxxxxxxx> <20050330170236.2bddf666.davem@xxxxxxxxxxxxx> <20050331231922.GA26587@xxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
Hi Dave:

Here is the version for 2.4.
Unfortunately my patch only closed half the race.  There is still
a chunk of code between netlink_dump_start and netlink_dump that runs
outside the cb lock which isn't protected by an sk reference.

Here is a better patch which protects the entire netlink_dump function
with a sk reference.

The other call to netlink_dump by recvmsg is safe as the open file
descriptor already holds a reference.  As such the final sock_put
in netlink_dump can be turned into a __sock_put since there is at
least one reference held by the caller.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Visit Openswan at
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page:
PGP Key:

Attachment: p
Description: Text document

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