HomeFreeBSD

MFC jail: Don't allow jails under dying parents

Description

MFC jail: Don't allow jails under dying parents

If a jail is created with jail_set(...JAIL_DYING), and it has a parent
currently in a dying state, that will bring the parent jail back to
life. Restrict that to require that the parent itself be explicitly
brought back first, and not implicitly created along with the new
child jail.

Differential Revision: https://reviews.freebsd.org/D28515

(cherry picked from commit 0a2a96f35a4c2dab3486438680fa289e12971e4b)

MFC jail: Fix locking on an early jail_set error.

I had locked allprison_lock without immediately setting PD_LIST_LOCKED.

(cherry picked from commit 108a9384e9e945cccba73c959f7e9cdb023cbcad)

Details

Provenance
jamieAuthored on Feb 23 2021, 1:04 AM
Differential Revision
D28515: Don't allow jail "accidental" resurrection of dead jails.
Parents
rG246339530348: MFC jail: Add PD_KILL to remove a prison in prison_deref().
Branches
Unknown
Tags
Unknown