[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <474AF9BF.2050603@trash.net>
Date: Mon, 26 Nov 2007 17:52:15 +0100
From: Patrick McHardy <kaber@...sh.net>
To: Herbert Xu <herbert@...dor.apana.org.au>
CC: "David S. Miller" <davem@...emloft.net>,
Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [XFRM]: Fix leak of expired xfrm_states
Herbert Xu wrote:
> On Mon, Nov 26, 2007 at 04:56:01PM +0100, Patrick McHardy wrote:
>> That should work as long as we keep the del_timer_sync to avoid
>> a use-after-free. It seems a bit fragile though.
>
> Well we're relying on the del_timer_sync already to avoid the
> ref count on the timer. Otherwise if the admin deletes the
> SA while the timer is running it'll go up in smoke too.
>
> If you look in the history you'll find that the same patch
> that removed the ref count on the timer introduced the call
> to del_timer_sync :)
OK, here's a patch to use xfrm_state_put in __xfrm_state_delete().
I've checked the other callers and it should be fine. lock ordering
between x->lock and xfrm_state_gc_lock also doesn't seem to be an
issue.
View attachment "x" of type "text/plain" (976 bytes)
Powered by blists - more mailing lists