⬢ DragonFlyBSD Kernel Audit
DF-2892 / fix.diff
← back to finding ↓ download raw
--- a/sys/vm/vm_contig.c	2026-06-29 12:51:19.000000000 +0000
+++ b/sys/vm/vm_contig.c	2026-10-26 00:25:42.777043079 +0000
@@ -265,6 +265,8 @@
 	size = round_page(size);
 	if (size == 0)
 		panic("vm_contig_pg_alloc: size must not be 0");
+	if (alignment == 0)
+		alignment = 1;
 	if ((alignment & (alignment - 1)) != 0)
 		panic("vm_contig_pg_alloc: alignment must be a power of 2");
 	if ((boundary & (boundary - 1)) != 0)
@@ -591,7 +598,7 @@
 	vm_page_t m;
 
 	if (size == 0)
-		panic("vm_contig_pg_kmap: size must not be 0");
+		panic("contigfree: size must not be 0");
 	size = round_page(size);
 
 	pa = pmap_kextract((vm_offset_t)addr);