DragonFlyBSD Kernel Audit
DF-1775 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/platform/pc64/x86_64/busdma_machdep.c b/sys/platform/pc64/x86_64/busdma_machdep.c
--- a/sys/platform/pc64/x86_64/busdma_machdep.c
+++ b/sys/platform/pc64/x86_64/busdma_machdep.c
@@ -236,6 +236,11 @@
 		alignment = 1;
 	if (alignment & (alignment - 1))
 		panic("alignment must be power of 2");
+	if (maxsize == 0) {
+		kprintf("bus_dma_tag_create: maxsize == 0\n");
+		print_backtrace(-1);
+		return EINVAL;
+	}
 
 	if (boundary != 0) {
 		if (boundary & (boundary - 1))