Commit 108a9384 authored by Jamie Gritton's avatar Jamie Gritton
Browse files

jail: Fix locking on an early jail_set error.

I had locked allprison_lock without immediately setting PD_LIST_LOCKED.
parent 1fc92877
...@@ -998,13 +998,13 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) ...@@ -998,13 +998,13 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags)
jid = 0; jid = 0;
} }
sx_xlock(&allprison_lock); sx_xlock(&allprison_lock);
drflags = PD_LIST_XLOCKED;
ppr = mypr; ppr = mypr;
if (!prison_isalive(ppr)) { if (!prison_isalive(ppr)) {
/* This jail is dying. This process will surely follow. */ /* This jail is dying. This process will surely follow. */
error = EAGAIN; error = EAGAIN;
goto done_deref; goto done_deref;
} }
drflags = PD_LIST_XLOCKED;
if (jid != 0) { if (jid != 0) {
if (jid < 0) { if (jid < 0) {
error = EINVAL; error = EINVAL;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment