summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2010-12-05 12:18:00 +0000
committerkettenis <kettenis@openbsd.org>2010-12-05 12:18:00 +0000
commit290fff21a72b661f9e5bc191e0a46e379ff19b3a (patch)
treefb2fd28ee1665d8d5215845fd55e44578d4aa762
parenttweak the framework so that individual modules don't exist and return (diff)
downloadwireguard-openbsd-290fff21a72b661f9e5bc191e0a46e379ff19b3a.tar.xz
wireguard-openbsd-290fff21a72b661f9e5bc191e0a46e379ff19b3a.zip
Make sure we only initialize the nfsrv_descript_pl pool once.
Re-initializing the pool everytime nfsd(8) terminates is very bad since it screws up the list of pools resulting in infinite loops when traversing that list. Issue found by Daniel Melameth. ok deraadt@
-rw-r--r--sys/nfs/nfs_syscalls.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index 0e583b7ba19..03edee3e145 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.91 2010/08/07 03:50:02 krw Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.92 2010/12/05 12:18:00 kettenis Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -549,8 +549,9 @@ nfsrv_init(int terminating)
M_WAITOK|M_ZERO);
TAILQ_INSERT_HEAD(&nfssvc_sockhead, nfs_udpsock, ns_chain);
- pool_init(&nfsrv_descript_pl, sizeof(struct nfsrv_descript), 0, 0, 0,
- "ndscpl", &pool_allocator_nointr);
+ if (!terminating)
+ pool_init(&nfsrv_descript_pl, sizeof(struct nfsrv_descript),
+ 0, 0, 0, "ndscpl", &pool_allocator_nointr);
}
#endif /* NFSSERVER */