Re: xfrm_state locking regression...
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2008-09-23 13:07:15
On Tue, Sep 23, 2008 at 04:01:29PM +0300, Timo Teräs wrote:
So, what to do? 1. Go back to: list_del_rcu, xfrm_state_hold(all.next) on delete and xfrm_state_put(all.next) on destruct. 2. Add per-entry hlist of walkers currently referencing it. 3. Use the global walker list. 1 can keep memory allocated until userland wakes up. 2 & 3 can make the delete of that entry slow if there's many walkers suspended.
I'd cross 3 off the list because 2 is just so much better :) I'd slightly lean towards 2 but now that you mention it yes even that is vulnerable to loads of dumpers sitting on the same entry. So SELINUX folks wouldn't like that :)
Btw. the current stuff in net-next is broken. There's no locking for xfrm_state_walkers list handling.
What about xfrm_cfg_mutex? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} [off-list ref] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt