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)
Sat, Mar 9, 9:36 PM
Unknown Object (File)
Sat, Mar 9, 9:36 PM
Unknown Object (File)
Sat, Mar 2, 3:25 AM
Unknown Object (File)
Feb 14 2024, 9:16 PM
Unknown Object (File)
Jan 11 2024, 7:45 AM
Unknown Object (File)
Jan 3 2024, 2:48 AM
Unknown Object (File)
Jan 3 2024, 2:48 AM
Unknown Object (File)
Dec 23 2023, 2:00 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 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.