Page MenuHomeFreeBSD

jail: Fix a race in prison_deref()
ClosedPublic

Authored by markj on Thu, Sep 24, 1:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 12, 3:51 AM
Unknown Object (File)
Mon, Oct 12, 2:26 AM
Unknown Object (File)
Fri, Oct 9, 12:43 AM
Unknown Object (File)
Wed, Oct 7, 11:53 PM
Unknown Object (File)
Wed, Oct 7, 10:44 PM
Unknown Object (File)
Wed, Oct 7, 9:40 PM
Unknown Object (File)
Mon, Oct 5, 6:57 PM
Unknown Object (File)
Mon, Oct 5, 3:39 PM
Subscribers

Details

Summary

If we're killing a jail which has some user refs pending, then we would
first drop our ref and then kill all processes in the prison. However,
it's possible for the prison to be freed before we finish that
operation, generally if the processes exit on their own before
prison_proc_iterate() returns.

Thus, defer the release of the prison refcount until after we've killed
all procs.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77274
Build 74157: arc lint + arc unit

Event Timeline

Yes, I'm referring to a prison I don't hold a reference to, without allprison_lock held. My bad. This look good, with the common path not adding any extra steps.

This revision is now accepted and ready to land.Thu, Sep 24, 5:59 PM
This revision was automatically updated to reflect the committed changes.