[issue1777] vn panic: Freeing already free credential! 0xdef403f8

Matthew Dillon dillon at apollo.backplane.com
Sat Jun 5 12:27:11 PDT 2010


:The vn structure appears to NOT be corrupt.  Seems like a race if
:vn->sc_cred goes from NULL to non-NULL between frame 6 and 5.  Could
:this be related to my recent link_elf change (setting p to proc0 if p
:is NULL)?
:
:Joe

    Hmm.  If devfs is racing access to that field then try changing the
    vnsetcred() code around a bit to this:

	struct ucred *ocred
	...


        /*
         * Set credits in our softc
         */
        ocred = vn->sc_cred;
        vn->sc_cred = crdup(cred);
        if (ocred)
                crfree(ocred);

    If the race is more involved then that (assuming it is a race), we
    may have to call crhold() and friends whenever we use vn->sc_cred.

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>





More information about the Bugs mailing list