DragonFlyBSD Kernel Audit
DF-1712 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/drm/i915/intel_fbdev.c b/sys/dev/drm/i915/intel_fbdev.c
--- a/sys/dev/drm/i915/intel_fbdev.c
+++ b/sys/dev/drm/i915/intel_fbdev.c
@@ -275,6 +275,10 @@
 	}
 #ifdef __DragonFly__
 	info->vaddr = (vm_offset_t)vaddr;
+	/* DFly struct fb_info has no screen_base/size; use vaddr + vma size.
+	 * Zero stolen frames to avoid leaking prior GPU memory. */
+	if (intel_fb_obj(fb)->stolen && !prealloc)
+		memset_io((void __iomem *)vaddr, 0, vma->node.size);
 #else
 	info->screen_base = vaddr;
 	info->screen_size = vma->node.size;