summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-04-14 12:39:38 +0000
committerjeff <jeff@FreeBSD.org>2002-04-14 12:39:38 +0000
commit8745059e4f7c816ee0f0b5fd0e603be493570c0e (patch)
treef2ed4c866cac7cd314092e20e87c055b761bb0b0 /sys
parent3b69e0094ce6b020016ab6d398abcd617b712a6c (diff)
downloadFreeBSD-src-8745059e4f7c816ee0f0b5fd0e603be493570c0e.zip
FreeBSD-src-8745059e4f7c816ee0f0b5fd0e603be493570c0e.tar.gz
Protect the initial list traversal in sysctl_vm_zone() with the uma_mtx.
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/uma_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 100a1ab..a0a4469 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -1947,8 +1947,10 @@ sysctl_vm_zone(SYSCTL_HANDLER_ARGS)
char *p;
cnt = 0;
+ mtx_lock(&uma_mtx);
LIST_FOREACH(z, &uma_zones, uz_link)
cnt++;
+ mtx_unlock(&uma_mtx);
MALLOC(tmpbuf, char *, (cnt == 0 ? 1 : cnt) * linesize,
M_TEMP, M_WAITOK);
len = snprintf(tmpbuf, linesize,
OpenPOWER on IntegriCloud