Page MenuHomeFreeBSD

Don't allow jail "accidental" resurrection of dead jails.

Authored by jamie on Feb 6 2021, 9:21 PM.
Referenced Files
Unknown Object (File)
Wed, Sep 6, 2:14 AM
Unknown Object (File)
Aug 14 2023, 6:46 PM
Unknown Object (File)
Aug 14 2023, 6:02 AM
Unknown Object (File)
May 27 2023, 11:46 PM
Unknown Object (File)
May 17 2023, 6:55 AM
Unknown Object (File)
May 15 2023, 6:00 AM
Unknown Object (File)
May 1 2023, 8:38 AM
Unknown Object (File)
Mar 27 2023, 10:21 PM



Stop dying jails from become alive again via races in fork(2) and jail_attach(2), and by the implicit rebirth of parent jails when a child jail is added when they're dying. Explicit rebirth the documented way, via the JAIL_DYING flag in jail_set(2), is still allowed.

The jail state and user reference count are a little more out of sync, with jail_remove(2) setting the state to dying before all the user references (processes) are gone. This makes pr_state the clear indicator of jail aliveness.

This builds on D28419, D27876, D28458, and D28473

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

jamie requested review of this revision.Feb 6 2021, 9:21 PM
jamie created this revision.

Fix up prison_deref_kill, which had some typos in which prison it was acting on. Also move prisons off of their parent's child lists along with the loop instead of all at the end.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 23 2021, 1:05 AM
This revision was automatically updated to reflect the committed changes.