WSL2-Linux-Kernel/net/xfrm
Tushar Gohad 8fcbc63701 XFRM: Fix memory leak in xfrm_state_update
Upon "ip xfrm state update ..", xfrm_add_sa() takes an extra reference on
the user-supplied SA and forgets to drop the reference when
xfrm_state_update() returns 0.  This leads to a memory leak as the
parameter SA is never freed.  This change attempts to fix the leak by
calling __xfrm_state_put() when xfrm_state_update() updates a valid SA
(err = 0).  The parameter SA is added to the gc list when the final
reference is dropped by xfrm_add_sa() upon completion.

Signed-off-by: Tushar Gohad <tgohad@mvista.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-07-08 08:58:42 -07:00
..
Kconfig
Makefile xfrm: Move IPsec replay detection functions to a separate file 2011-03-13 20:22:30 -07:00
xfrm_algo.c xfrm: Pass name as const to xfrm_*_get_byname(). 2011-02-27 23:04:45 -08:00
xfrm_hash.c net: allow GFP_HIGHMEM in __vmalloc() 2010-11-21 10:04:04 -08:00
xfrm_hash.h xfrm: Const'ify address args to hash helpers. 2011-02-23 23:07:42 -08:00
xfrm_input.c xfrm: Move the test on replay window size into the replay check functions 2011-03-28 23:34:51 -07:00
xfrm_ipcomp.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
xfrm_output.c dst: Clone child entry in skb_dst_pop 2011-03-27 17:55:01 -07:00
xfrm_policy.c xfrm: Remove family arg from xfrm_bundle_ok 2011-07-01 17:33:19 -07:00
xfrm_proc.c xfrm: Introduce LINUX_MIB_XFRMFWDHDRERROR 2010-02-18 15:43:09 -08:00
xfrm_replay.c xfrm: Fix off by one in the replay advance functions 2011-06-07 21:14:39 -07:00
xfrm_state.c XFRM: Fix memory leak in xfrm_state_update 2011-07-08 08:58:42 -07:00
xfrm_sysctl.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
xfrm_user.c xfrm: Check for the new replay implementation if an esn state is inserted 2011-04-26 12:46:04 -07:00