]> git.itanic.dy.fi Git - linux-stable/commit
ipsec: Fix deadlock in xfrm_state management.
authorDavid S. Miller <davem@davemloft.net>
Wed, 3 Sep 2008 08:03:39 +0000 (01:03 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 8 Sep 2008 11:44:29 +0000 (04:44 -0700)
commit464f8f4932d128a3e80402ec85d7c40c1f5e6899
tree6dd7dad513ecfcafc7bb77a896d08e4b5d202fd6
parentff134d489673b3d678d313e8dddae24c05eb0291
ipsec: Fix deadlock in xfrm_state management.

[ Upstream commit 37b08e34a98c664bea86e3fae718ac45a46b7276 ]

Ever since commit 4c563f7669c10a12354b72b518c2287ffc6ebfb3
("[XFRM]: Speed up xfrm_policy and xfrm_state walking") it is
illegal to call __xfrm_state_destroy (and thus xfrm_state_put())
with xfrm_state_lock held.  If we do, we'll deadlock since we
have the lock already and __xfrm_state_destroy() tries to take
it again.

Fix this by pushing the xfrm_state_put() calls after the lock
is dropped.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/xfrm/xfrm_state.c