Page MenuHomeFreeBSD

Fix a regression that creates zombies when removing already-dying jails
ClosedPublic

Authored by jamie on Oct 19 2025, 5:55 PM.
Tags
None
Referenced Files
F156726608: D53200.id164544.diff
Fri, May 15, 10:53 PM
F156698895: D53200.id164628.diff
Fri, May 15, 6:34 PM
F156698853: D53200.id164628.diff
Fri, May 15, 6:33 PM
F156698751: D53200.id164628.diff
Fri, May 15, 6:32 PM
F156695956: D53200.diff
Fri, May 15, 6:09 PM
Unknown Object (File)
Thu, May 14, 11:42 AM
Unknown Object (File)
Wed, May 13, 11:41 PM
Unknown Object (File)
Wed, May 13, 10:45 PM
Subscribers

Details

Summary

Jail descriptors broke the sys_jail_remove function in two, with prison_remove doing the second half of the work. To work with other callers, prison_remove requires the jail be held and releases the hold, so sys_jail_remove holds the jail before calling it.

But prison_remove only did half the job of removing the hold; it would keep it when bailing out from an attempt to kill an already-dying jail.

The fix is to remove the dying jail from prison_remove, and handle it in prison_deref instead (and to do it correctly).

Test Plan

Bug 290217 has some tests that create these zombie jails, and can serve as a test case.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable