* [patch 2/4] drm/qxl: potential NULL dereference in apply_reloc()
@ 2015-09-17 11:23 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-09-17 11:23 UTC (permalink / raw)
To: David Airlie
Cc: Dave Airlie, security, Ilja Van Sprundel, dri-devel,
Frediano Ziglio
qxl_bo_kmap_atomic_page() can fail. I think the user controls
->dst_offset so this can be used to corrupt memory.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c
index eda6f30..b2db482 100644
--- a/drivers/gpu/drm/qxl/qxl_ioctl.c
+++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
@@ -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
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-17 11:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-17 11:23 [patch 2/4] drm/qxl: potential NULL dereference in apply_reloc() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox