Skip to contentSkip to conversation

drm/qxl: potential NULL dereference in apply_reloc()

PATCH Superseded Dan Carpenter 1 participant 1 message Sep 17, 2015

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 drm/qxl: potential NULL dereference in apply_reloc()

qxl_bo_kmap_atomic_page() can fail. I think the user controls ->dst_offset so this can be used to corrupt memory.

drivers/gpu/drm/qxl/qxl_ioctl.c +2 -0
index eda6f30..b2db482 100644
@@ -86,6 +86,8 @@ apply_reloc(struct qxl_device *qdev, struct qxl_reloc_info *info)
 {
 	void *reloc_page;
 	reloc_page = qxl_bo_kmap_atomic_page(qdev, info->dst_bo, info->dst_offset & PAGE_MASK);
+	if (!reloc_page)
+		return;
 	*(uint64_t *)(reloc_page + (info->dst_offset & ~PAGE_MASK)) = qxl_bo_physical_address(qdev,
 											      info->src_bo,
 											      info->src_offset);

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel