DragonFlyBSD Kernel Audit
DF-1727 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/drm/include/linux/gfp.h b/sys/dev/drm/include/linux/gfp.h
--- a/sys/dev/drm/include/linux/gfp.h
+++ b/sys/dev/drm/include/linux/gfp.h
@@ -64,11 +64,13 @@
 static inline struct page * alloc_page(int flags)
 {
 	vm_paddr_t high = BUS_SPACE_MAXADDR;
+	int vmflags = VM_ALLOC_NORMAL | VM_ALLOC_SYSTEM | VM_ALLOC_INTERRUPT;
 
 	if (flags & GFP_DMA32)
 		high = BUS_SPACE_MAXADDR_32BIT;
-	return (struct page *)vm_page_alloczwq(0, VM_ALLOC_NORMAL | VM_ALLOC_SYSTEM |
-				  VM_ALLOC_INTERRUPT);
+	if (flags & __GFP_ZERO)		/* DF-1727: honor the zero request */
+		vmflags |= VM_ALLOC_ZERO;
+	return (struct page *)vm_page_alloczwq(0, vmflags);
 }
 
 static inline bool