浏览代码

[XFRM]: Fix leak of expired xfrm_states

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>
Patrick McHardy 17 年之前
父节点
当前提交
5dba479711
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/xfrm/xfrm_state.c

+ 1 - 1
net/xfrm/xfrm_state.c

@@ -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;
 	}