Page MenuHomeFreeBSD

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

Authored by jamie on Feb 6 2021, 9:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 30, 1:51 PM
Unknown Object (File)
Sat, Oct 19, 8:25 AM
Unknown Object (File)
Sep 30 2024, 11:09 AM
Unknown Object (File)
Sep 29 2024, 10:33 PM
Unknown Object (File)
Sep 28 2024, 7:24 AM
Unknown Object (File)
Sep 27 2024, 2:53 PM
Unknown Object (File)
Sep 25 2024, 1:00 AM
Unknown Object (File)
Sep 24 2024, 3:09 PM
Subscribers
None

Details

Summary

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

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
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.