Messages in this thread | | | Subject | Re: [PATCH] netfilter: nf_conntrack: fix RCU race in nf_conntrack_find_get (v3) | From | Eric Dumazet <> | Date | Tue, 14 Jan 2014 06:36:41 -0800 |
| |
On Tue, 2014-01-14 at 14:51 +0400, Andrew Vagin wrote:
> I think __nf_conntrack_alloc must use atomic_inc instead of > atomic_set. And we must be sure, that the first object from a new page is > zeroized.
No you can not do that, and we do not need.
If a new page is allocated, then you have the guarantee nobody can ever uses it, its content can be totally random.
Only 'living' objects, the ones that were previously inserted in the hash table, can be found, and their refcnt must be accurate.
A freed object has refcnt == 0, thats the golden rule.
When the page is freed (after RCU grace period), nobody cares of refcnt anymore.
| |