Skip to content

Commit

Permalink
[XFRM]: Fix leak of expired xfrm_states
Browse files Browse the repository at this point in the history
The xfrm_timer calls __xfrm_state_delete, which drops the final reference
manually without triggering destruction of the state. Change it to use
xfrm_state_put to add the state to the gc list when we're dropping the
last reference. The timer function may still continue to use the state
safely since the final destruction does a del_timer_sync().

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
kaber authored and herbertx committed Nov 27, 2007
1 parent 8a8037a commit 5dba479
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ int __xfrm_state_delete(struct xfrm_state *x)
* The xfrm_state_alloc call gives a reference, and that
* is what we are dropping here.
*/
__xfrm_state_put(x);
xfrm_state_put(x);
err = 0;
}

Expand Down

0 comments on commit 5dba479

Please sign in to comment.