⬢ DragonFlyBSD Kernel Audit
DF-2891 / 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
@@ -523,6 +525,11 @@
 
 	if (size == 0)
 		panic("vm_contig_pg_kmap: size must not be 0");
+	/*
+	 * The map argument is currently only supported for kernel_map;
+	 * freeing through any other map would corrupt the wrong vm_map.
+	 */
+	KKASSERT(map == kernel_map);
 	size = round_page(size);
 	addr = kmem_alloc_pageable(kernel_map, size, VM_SUBSYS_CONTIG);
 	if (addr) {