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

Minor jail bug in fork1()/kern_execve()

From: Paul Herman <pherman@xxxxxxxxxxxxxxx>
Date: Sat, 20 Mar 2004 20:19:08 -0800 (PST)


While playing around with some jail() stuff, I've found that the
prison refcount gets bumped twice when a jailed process fork()s and
exec()s instead of just once like it should.  The reason is that
fork1() increments the refcount itself and it also gets incremented
a second time when kern_execve() calls cratom().  The result is
that when jails with forked processes finally exit, their prisons
don't get freed.

It makes sense to me that the refcount should be bumped in fork()
and less sense to me in kern_execve().

I think we might rethink the idea that cratom() should be touching
the prison refcount.  And if cratom() should, then kern_execve()
shouldn't.  Any thoughts?


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