DragonFlyBSD Kernel Audit
DF-0238 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/kern/kern_wdog.c b/sys/kern/kern_wdog.c
--- a/sys/kern/kern_wdog.c
+++ b/sys/kern/kern_wdog.c
@@ -130,7 +130,9 @@
 {
 	int		error;
 
+	spin_lock(&wdogmtx);
 	error = sysctl_handle_int(oidp, &wdog_auto_enable, 1, req);
+	spin_unlock(&wdogmtx);
 	if (error || req->newptr == NULL)
 		return error;
 
@@ -151,7 +153,9 @@
 {
 	int		error;
 
+	spin_lock(&wdogmtx);
 	error = sysctl_handle_int(oidp, &wdog_auto_period, WDOG_DEFAULT_PERIOD, req);
+	spin_unlock(&wdogmtx);
 	if (error || req->newptr == NULL)
 		return error;