HomeFreeBSD

jail: clean up locking around do_jail_attach

Description

jail: clean up locking around do_jail_attach

jail_attach_jd passed PD_DEREF to do_jail_attach, assuming it would take
care of freeing the held prison. This is not true, as do_jail_attach
immediately cleared that flag, leaving the jail stock in dying state
when it is later removed.

Reported by: markj
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D57674

(cherry picked from commit 3584cde63e416d150214192721cead4b735ca0b5)

Details

Provenance
jamieAuthored on Jun 25 2026, 3:21 AM
Parents
rG334c8ba7dd9c: jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails
Branches
Unknown
Tags
Unknown