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
F104415599: D28515.diff
Sat, Dec 7, 2:35 AM
Unknown Object (File)
Thu, Nov 14, 12:40 PM
Unknown Object (File)
Wed, Nov 13, 7:22 PM
Unknown Object (File)
Oct 30 2024, 1:51 PM
Unknown Object (File)
Oct 19 2024, 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
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 Skipped
Unit
Tests Skipped

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.