⬢ DragonFlyBSD Kernel Audit
DF-5538 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/platform/vkernel64/platform/copyio.c b/sys/platform/vkernel64/platform/copyio.c
index 55c1e93..b7e2f21 100644
--- a/sys/platform/vkernel64/platform/copyio.c
+++ b/sys/platform/vkernel64/platform/copyio.c
@@ -162,7 +162,7 @@ swapu32(volatile uint32_t *p, uint32_t val)
 	int busy;
 
 	/* XXX No idea how to handle this case in a simple way, just abort */
-	if (PAGE_SIZE - ((vm_offset_t)p & PAGE_MASK) < sizeof(uint64_t))
+	if (PAGE_SIZE - ((vm_offset_t)p & PAGE_MASK) < sizeof(uint32_t))
 		return -1;
 
 	m = vm_fault_page(&vm->vm_map, trunc_page((vm_offset_t)p),
@@ -226,7 +226,7 @@ fuwordadd32(volatile uint32_t *p, uint32_t val)
 	int busy;
 
 	/* XXX No idea how to handle this case in a simple way, just abort */
-	if (PAGE_SIZE - ((vm_offset_t)p & PAGE_MASK) < sizeof(uint64_t))
+	if (PAGE_SIZE - ((vm_offset_t)p & PAGE_MASK) < sizeof(uint32_t))
 		return -1;
 
 	m = vm_fault_page(&vm->vm_map, trunc_page((vm_offset_t)p),