Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jan 2021 18:53:48 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: 39c8ef90f6d0 - main - jail: A jail could be removed without calling OSD methods
Message-ID:  <202101221853.10MIrmYb000878@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=39c8ef90f6d035cd3c3ab40e051b1c0f419c76be

commit 39c8ef90f6d035cd3c3ab40e051b1c0f419c76be
Author:     Jamie Gritton <jamie@FreeBSD.org>
AuthorDate: 2021-01-22 18:50:10 +0000
Commit:     Jamie Gritton <jamie@FreeBSD.org>
CommitDate: 2021-01-22 18:50:10 +0000

    jail: A jail could be removed without calling OSD methods
    
    Fix a long-standing bug where setting nopersist on a process-less jail
    would remove it without calling the the OSD PR_METHOD_REMOVE methods.
---
 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 e869bafc96b8..318f81fb13be 100644
--- a/sys/kern/kern_jail.c
+++ b/sys/kern/kern_jail.c
@@ -1741,8 +1741,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags)
 			prison_hold(pr);
 			refcount_acquire(&pr->pr_uref);
 		} else {
-			refcount_release(&pr->pr_uref);
 			refcount_release(&pr->pr_ref);
+			drflags |= PD_DEUREF;
 		}
 	}
 	pr->pr_flags = (pr->pr_flags & ~ch_flags) | pr_flags;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101221853.10MIrmYb000878>