• David S. Miller's avatar
    ipsec: Fix deadlock in xfrm_state management. · 37b08e34
    David S. Miller authored
    Ever since commit 4c563f76
    ("[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: default avatarDavid S. Miller <davem@davemloft.net>
    37b08e34
xfrm_state.c 52 KB