The branch main has been updated by jamie:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=25c2c952e3f64ec1a59033c0e2dc870a6c818a84

commit 25c2c952e3f64ec1a59033c0e2dc870a6c818a84
Author:     Jamie Gritton <ja...@freebsd.org>
AuthorDate: 2021-01-18 01:37:03 +0000
Commit:     Jamie Gritton <ja...@freebsd.org>
CommitDate: 2021-01-18 01:41:09 +0000

    jail: Add proper prison locking in mqfs_prison_remove.
---
 sys/kern/uipc_mqueue.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c
index fc888023a40f..309fa3423fbd 100644
--- a/sys/kern/uipc_mqueue.c
+++ b/sys/kern/uipc_mqueue.c
@@ -1562,14 +1562,16 @@ static int
 mqfs_prison_remove(void *obj, void *data __unused)
 {
        const struct prison *pr = obj;
-       const struct prison *tpr;
+       struct prison *tpr;
        struct mqfs_node *pn, *tpn;
        int found;
 
        found = 0;
        TAILQ_FOREACH(tpr, &allprison, pr_list) {
+               prison_lock(tpr);
                if (tpr->pr_root == pr->pr_root && tpr != pr && tpr->pr_ref > 0)
                        found = 1;
+               prison_unlock(tpr);
        }
        if (!found) {
                /*
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to