* Patch "drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()" has been added to the 4.10-stable tree
@ 2017-04-09 8:25 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-04-09 8:25 UTC (permalink / raw)
To: murray.mcallister, gregkh, syeh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()
to the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
drm-vmwgfx-null-pointer-dereference-in-vmw_surface_define_ioctl.patch
and it can be found in the queue-4.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 36274ab8c596f1240c606bb514da329add2a1bcd Mon Sep 17 00:00:00 2001
From: Murray McAllister <murray.mcallister@insomniasec.com>
Date: Mon, 27 Mar 2017 11:12:53 +0200
Subject: drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()
From: Murray McAllister <murray.mcallister@insomniasec.com>
commit 36274ab8c596f1240c606bb514da329add2a1bcd upstream.
Before memory allocations vmw_surface_define_ioctl() checks the
upper-bounds of a user-supplied size, but does not check if the
supplied size is 0.
Add check to avoid NULL pointer dereferences.
Signed-off-by: Murray McAllister <murray.mcallister@insomniasec.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -716,8 +716,8 @@ int vmw_surface_define_ioctl(struct drm_
for (i = 0; i < DRM_VMW_MAX_SURFACE_FACES; ++i)
num_sizes += req->mip_levels[i];
- if (num_sizes > DRM_VMW_MAX_SURFACE_FACES *
- DRM_VMW_MAX_MIP_LEVELS)
+ if (num_sizes > DRM_VMW_MAX_SURFACE_FACES * DRM_VMW_MAX_MIP_LEVELS ||
+ num_sizes == 0)
return -EINVAL;
size = vmw_user_surface_size + 128 +
Patches currently in stable-queue which might be from murray.mcallister@insomniasec.com are
queue-4.10/drm-vmwgfx-avoid-calling-vzalloc-with-a-0-size-in-vmw_get_cap_3d_ioctl.patch
queue-4.10/drm-vmwgfx-null-pointer-dereference-in-vmw_surface_define_ioctl.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-04-09 8:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-09 8:25 Patch "drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()" has been added to the 4.10-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).