Lock Giant around a call to userland_sysctl() in ibcs2_sysi86().

Approved by:	re (scottl)
This commit is contained in:
jhb 2005-07-07 19:30:30 +00:00
parent c7cb86e1e4
commit c91989d29b

View File

@ -31,6 +31,8 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
@ -78,8 +80,11 @@ ibcs2_sysi86(struct thread *td, struct ibcs2_sysi86_args *args)
return (error);
name[0] = CTL_KERN;
name[1] = KERN_HOSTNAME;
return (userland_sysctl(td, name, 2, 0, 0, 0,
args->arg, 7, 0, 0));
mtx_lock(&Giant);
error = userland_sysctl(td, name, 2, 0, 0, 0,
args->arg, 7, 0, 0);
mtx_unlock(&Giant);
return (error);
}
case SI86_MEM: /* size of physical memory */