DragonFly BSD
DragonFly bugs List (threaded) for 2010-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: Joe Talbott <josepht@xxxxxxxxxx>
Date: Sat, 5 Jun 2010 18:18:13 -0400

On Sat, Jun 05, 2010 at 06:13:29PM -0400, Joe Talbott wrote:
> 
> Please try this patch.  I was able to vnconfig a file following the
> vkernel manpage without a panic.  This isn't likely a long term
> solution but will hopefully allow you to proceed with your GSoC work
> in a vkernel.  If you see this panic again let me know and I'll work
> on implementing the crhold() et al. calls as Matt suggested.
> 

Forgot to copy the patch to my mail server.  This is the one I
intended to send.

Thanks,
Joe
diff --git a/sys/dev/disk/vn/vn.c b/sys/dev/disk/vn/vn.c
index 95bcf44..f7f216f 100644
--- a/sys/dev/disk/vn/vn.c
+++ b/sys/dev/disk/vn/vn.c
@@ -690,17 +690,19 @@ vniocattach_swap(struct vn_softc *vn, struct vn_ioctl *vio, cdev_t dev,
 int
 vnsetcred(struct vn_softc *vn, struct ucred *cred)
 {
+	struct ucred *ocred;
 	char *tmpbuf;
 	int error = 0;
 
 	/*
 	 * Set credits in our softc
 	 */
-
-	if (vn->sc_cred)
-		crfree(vn->sc_cred);
+	ocred = vn->sc_cred;
 	vn->sc_cred = crdup(cred);
 
+	if (ocred)
+		crfree(ocred);
+
 	/*
 	 * Horrible kludge to establish credentials for NFS  XXX.
 	 */


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