Date: Fri, 26 Feb 2021 03:54:01 GMT From: Jamie Gritton <jamie@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 108a9384e9e9 - main - jail: Fix locking on an early jail_set error. Message-ID: <202102260354.11Q3s1cr036028@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=108a9384e9e945cccba73c959f7e9cdb023cbcad commit 108a9384e9e945cccba73c959f7e9cdb023cbcad Author: Jamie Gritton <jamie@FreeBSD.org> AuthorDate: 2021-02-26 03:52:58 +0000 Commit: Jamie Gritton <jamie@FreeBSD.org> CommitDate: 2021-02-26 03:52:58 +0000 jail: Fix locking on an early jail_set error. I had locked allprison_lock without immediately setting PD_LIST_LOCKED. --- sys/kern/kern_jail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index c58751e6f5fe..c8dcf928dfaa 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -998,13 +998,13 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) jid = 0; } sx_xlock(&allprison_lock); + drflags = PD_LIST_XLOCKED; ppr = mypr; if (!prison_isalive(ppr)) { /* This jail is dying. This process will surely follow. */ error = EAGAIN; goto done_deref; } - drflags = PD_LIST_XLOCKED; if (jid != 0) { if (jid < 0) { error = EINVAL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102260354.11Q3s1cr036028>