From: Eric Dumazet Date: Thu, 18 Oct 2012 03:21:55 +0000 (+0000) Subject: netlink: use kfree_rcu() in netlink_release() X-Git-Tag: v3.7-rc3~7^2~27 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d772ac5578f711d1ce7b03535d1c95bffb21dff;p=pandora-kernel.git netlink: use kfree_rcu() in netlink_release() 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 Signed-off-by: Eric Dumazet Cc: Stéphane Marchesin Cc: Sam Leffler Signed-off-by: David S. Miller --- Reading git-diff-tree failed