kern/126368: Running ktrace/kdump in jail leads to stale jails

Bjoern A. Zeeb bz at FreeBSD.org
Fri Aug 8 19:02:04 UTC 2008


On Fri, 8 Aug 2008, Mateusz Guzik wrote:

> The following reply was made to PR kern/126368; it has been noted by GNATS.
>
> From: "Mateusz Guzik" <mjguzik at gmail.com>
> To: bug-followup at freebsd.org
> Cc:
> Subject: Re: kern/126368: Running ktrace/kdump in jail leads to stale jails
> Date: Fri, 8 Aug 2008 19:30:22 +0200
>
> Err, I made a mistake. crfree() will be called in case of failure
> (loop starting at line 959), so the following patch should be ok:
>
> --- sys/kern/kern_ktrace.c.orig	2008-08-08 16:37:45.000000000 +0200
> +++ sys/kern/kern_ktrace.c	2008-08-08 19:25:16.000000000 +0200
> @@ -933,12 +933,14 @@
>  		error = VOP_WRITE(vp, &auio, IO_UNIT | IO_APPEND, cred);
>  	VOP_UNLOCK(vp, 0, td);
>  	vn_finished_write(mp);
>  	vrele(vp);
>  	VFS_UNLOCK_GIANT(vfslocked);
> -	if (!error)
> +	if (!error) {
> +		crfree(cred);
>  		return;
> +	}

that sounds more plausible w/o seeing the surrounding code. I had
wondered already earlier today when I was pointed at.

I'll look into this.


>  	/*
>  	 * If error encountered, give up tracing on this vnode.  We defer
>  	 * all the vrele()'s on the vnode until after we are finished walking
>  	 * the various lists to avoid needlessly holding locks.
>  	 */
> _______________________________________________
> freebsd-jail at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-jail
> To unsubscribe, send any mail to "freebsd-jail-unsubscribe at freebsd.org"
>

-- 
Bjoern A. Zeeb              Stop bit received. Insert coin for new game.


More information about the freebsd-jail mailing list