add qxl fix for missing access ok macro.

This commit is contained in:
Dave Airlie 2013-06-28 14:35:58 +10:00
parent 0047ecfc5e
commit a82de48640
2 changed files with 35 additions and 0 deletions

30
drm-qxl-access-fix.patch Normal file
View File

@ -0,0 +1,30 @@
From 18097b91aaff215e843f04b84ec2c686270bb55f Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Fri, 28 Jun 2013 13:27:40 +1000
Subject: [PATCH] drm/qxl: add missing access check for execbuffer ioctl
Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/qxl/qxl_ioctl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c
index a4b71b2..a30f294 100644
--- a/drivers/gpu/drm/qxl/qxl_ioctl.c
+++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
@@ -171,6 +171,11 @@ static int qxl_execbuffer_ioctl(struct drm_device *dev, void *data,
if (user_cmd.command_size > PAGE_SIZE - sizeof(union qxl_release_info))
return -EINVAL;
+ if (!access_ok(VERIFY_READ,
+ (void *)(unsigned long)user_cmd.command,
+ user_cmd.command_size))
+ return -EFAULT;
+
ret = qxl_alloc_release_reserved(qdev,
sizeof(union qxl_release_info) +
user_cmd.command_size,
--
1.8.1.2

View File

@ -671,6 +671,7 @@ Patch1000: devel-pekey-secure-boot-20130306.patch
Patch1700: drm-ttm-exports-for-qxl.patch
Patch1701: drm-qxl-driver.patch
Patch1702: drm-qxl-backport-fixes.patch
Patch1703: drm-qxl-access-fix.patch
# nouveau + drm fixes
# intel drm is all merged upstream
Patch1824: drm-intel-next.patch
@ -1435,6 +1436,7 @@ ApplyPatch devel-pekey-secure-boot-20130306.patch
ApplyPatch drm-ttm-exports-for-qxl.patch
ApplyPatch drm-qxl-driver.patch
ApplyPatch drm-qxl-backport-fixes.patch
ApplyPatch drm-qxl-access-fix.patch
#ApplyPatch drm-edid-try-harder-to-fix-up-broken-headers.patch
#ApplyPatch drm-vgem.patch
@ -2365,6 +2367,9 @@ fi
# and build.
%changelog
* Fri Jun 28 2013 Dave Airlie <airlied@redhat.com>
- add qxl fix for missing access ok macro.
* Thu Jun 27 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.8-300
- Linux v3.9.8