]> err.no Git - linux-2.6/commit
[NET]: Fix the race between sk_filter_(de|at)tach and sk_clone()
authorPavel Emelyanov <xemul@openvz.org>
Thu, 18 Oct 2007 04:22:42 +0000 (21:22 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Oct 2007 04:22:42 +0000 (21:22 -0700)
commit47e958eac280c263397582d5581e868c3227a1bd
tree67fc50a26b7861b3330eae7f1874df851c0ef740
parentd3904b739928edd83d117f1eb5bfa69f18d6f046
[NET]: Fix the race between sk_filter_(de|at)tach and sk_clone()

The proposed fix is to delay the reference counter decrement
until the quiescent state pass. This will give sk_clone() a
chance to get the reference on the cloned filter.

Regular sk_filter_uncharge can happen from the sk_free() only
and there's no need in delaying the put - the socket is dead
anyway and is to be release itself.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/core/filter.c