NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/35351: fileassoc lacks locking



On Sun, 22 Jan 2012 11:39:29 -0500
Elad Efrat <elad%NetBSD.org@localhost> wrote:

> Attached is a diff that adds locking to fileassoc(9). It fixes two
> panics that I can easily trigger through Veriexec.
> 
> A version of it (earlier? can't remember) was discussed here:
> 
>    http://mail-index.netbsd.org/tech-kern/2009/12/26/msg006703.html
> 
> I don't find the "it's not perfect" line of reasoning convincing, so
> my recommendation is to check it in. It's filed so it doesn't get
> lost.

The only part that's not totally clear to me (from the diff alone) is
when a hash table is rehashed, where/when the old table gets freed?

+       /* Free the old hash table, and plug in the new one. */
        hashdone(tbl->tbl_hash, HASH_LIST, tbl->tbl_mask);
-       specificdata_fini(fileassoc_domain, &tbl->tbl_data);
-       kmem_free(tbl, sizeof(*tbl));
+       tbl->tbl_hash = new_hash;
+       tbl->tbl_nslots = new_nslots;
+       tbl->tbl_mask = new_mask;

Of course I may have overlooked something too.

Thanks,
-- 
Matt


Home | Main Index | Thread Index | Old Index