[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110708030032.GA25702@gondor.apana.org.au>
Date: Fri, 8 Jul 2011 11:00:32 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Tushar Gohad <tgohad@...sta.com>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
tusharsg@...il.com
Subject: Re: [PATCH] XFRM: Fix memory leak in xfrm_state_update
On Thu, Jul 07, 2011 at 06:38:52PM -0700, Tushar Gohad wrote:
>
> 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@...sta.com>
Ouch, thanks for catching this bug!
Acked-by: Herbert Xu <herbert@...dor.apana.org.au>
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists