Commit 9aa67118 authored by Patrick McHardy's avatar Patrick McHardy Committed by Greg Kroah-Hartman

XFRM: Fix leak of expired xfrm_states

[XFRM]: Fix leak of expired xfrm_states

[ Upstream commit: 5dba4797 ]

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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9ee303ef
...@@ -370,7 +370,7 @@ int __xfrm_state_delete(struct xfrm_state *x) ...@@ -370,7 +370,7 @@ int __xfrm_state_delete(struct xfrm_state *x)
* The xfrm_state_alloc call gives a reference, and that * The xfrm_state_alloc call gives a reference, and that
* is what we are dropping here. * is what we are dropping here.
*/ */
__xfrm_state_put(x); xfrm_state_put(x);
err = 0; err = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment