dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -fixes 1/9] drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl()
@ 2017-06-07 13:24 Thomas Hellstrom
  2017-06-07 13:24 ` [PATCH -fixes 2/9] drm/vmwgfx: Don't create proxy surface for cursor Thomas Hellstrom
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Thomas Hellstrom @ 2017-06-07 13:24 UTC (permalink / raw)
  To: dri-devel; +Cc: Vladis Dronov, stable

From: Vladis Dronov <vdronov@redhat.com>

The 'req->mip_levels' parameter in vmw_gb_surface_define_ioctl() is
a user-controlled 'uint32_t' value which is used as a loop count limit.
This can lead to a kernel lockup and DoS. Add check for 'req->mip_levels'.

References:
https://bugzilla.redhat.com/show_bug.cgi?id=1437431

Cc: <stable@vger.kernel.org>
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index 7681341..baf03d4 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -1279,6 +1279,9 @@ int vmw_gb_surface_define_ioctl(struct drm_device *dev, void *data,
 	if (req->multisample_count != 0)
 		return -EINVAL;
 
+	if (req->mip_levels > DRM_VMW_MAX_MIP_LEVELS)
+		return -EINVAL;
+
 	if (unlikely(vmw_user_surface_size == 0))
 		vmw_user_surface_size = ttm_round_pot(sizeof(*user_srf)) +
 			128;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-06-07 13:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-07 13:24 [PATCH -fixes 1/9] drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl() Thomas Hellstrom
2017-06-07 13:24 ` [PATCH -fixes 2/9] drm/vmwgfx: Don't create proxy surface for cursor Thomas Hellstrom
2017-06-07 13:24 ` [PATCH -fixes 3/9] drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve() Thomas Hellstrom
2017-06-07 13:24 ` [PATCH -fixes 4/9] drm/vmwgfx: Make sure backup_handle is always valid Thomas Hellstrom
2017-06-07 13:24 ` [PATCH -fixes 5/9] drm/vmwgfx: Make sure to update STDU when FB is updated Thomas Hellstrom
2017-06-07 13:24 ` [PATCH -fixes 6/9] drm/vmwgfx: Fix large topology crash Thomas Hellstrom
2017-06-07 13:24 ` [PATCH -fixes 7/9] drm/vmwgfx: fix spelling mistake "exeeds" -> "exceeds" Thomas Hellstrom
2017-06-07 13:24 ` [PATCH -fixes 8/9] drm/vmwgfx: Remove unused legacy cursor functions Thomas Hellstrom
2017-06-07 13:24 ` [PATCH -fixes 9/9] drm/vmwgfx: Bump driver minor and date Thomas Hellstrom

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).