android_kernel_google_msm/net/netlink
Eric Dumazet 0f04b9af7c netlink: use kfree_rcu() in netlink_release()
[ Upstream commit 6d772ac557 ]

On some suspend/resume operations involving wimax device, we have
noticed some intermittent memory corruptions in netlink code.

Stéphane Marchesin tracked this corruption in netlink_update_listeners()
and suggested a patch.

It appears netlink_release() should use kfree_rcu() instead of kfree()
for the listeners structure as it may be used by other cpus using RCU
protection.

netlink_release() must set to NULL the listeners pointer when
it is about to be freed.

Also have to protect netlink_update_listeners() and
netlink_has_listeners() if listeners is NULL.

Add a nl_deref_protected() lockdep helper to properly document which
locks protects us.

Reported-by: Jonathan Kliegman <kliegs@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Stéphane Marchesin <marcheu@google.com>
Cc: Sam Leffler <sleffler@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-17 13:16:14 -08:00
..
af_netlink.c netlink: use kfree_rcu() in netlink_release() 2012-11-17 13:16:14 -08:00
genetlink.c netlink: add netlink_dump_control structure for netlink_dump_start() 2012-02-26 14:10:06 -05:00
Makefile