⬢ DragonFlyBSD Kernel Audit
DF-2888 / fix.diff
← back to finding ↓ download raw
--- a/sys/vm/vm_meter.c	2026-06-29 12:51:19.000000000 +0000
+++ b/sys/vm/vm_meter.c	2026-10-26 00:25:42.777043079 +0000
@@ -243,14 +243,16 @@
 vcnt(SYSCTL_HANDLER_ARGS)
 {
 	int i;
-	int count = 0;
+	int64_t count = 0;
+	u_int out;
 	int offset = arg2;
 
 	for (i = 0; i < ncpus; ++i) {
 		struct globaldata *gd = globaldata_find(i);
 		count += *(int *)((char *)&gd->gd_cnt + offset);
 	}
-	return(SYSCTL_OUT(req, &count, sizeof(int)));
+	out = (u_int)count;
+	return(SYSCTL_OUT(req, &out, sizeof(out)));
 }
 
 /*
@@ -260,7 +262,8 @@
 vcnt_intr(SYSCTL_HANDLER_ARGS)
 {
 	int i;
-	int count = 0;
+	int64_t count = 0;
+	u_int out;
 
 	for (i = 0; i < ncpus; ++i) {
 		struct globaldata *gd = globaldata_find(i);
@@ -268,7 +271,8 @@
 		count += gd->gd_cnt.v_intr + gd->gd_cnt.v_ipi +
 			 gd->gd_cnt.v_timer;
 	}
-	return(SYSCTL_OUT(req, &count, sizeof(int)));
+	out = (u_int)count;
+	return(SYSCTL_OUT(req, &out, sizeof(out)));
 }
 
 #define VMMETEROFF(var)	offsetof(struct vmmeter, var)