linux/drivers/gpu/drm/vmwgfx
Xi Wang 8a78389651 vmwgfx: fix incorrect VRAM size check in vmw_kms_fb_create()
Commit e133e737 didn't correctly fix the integer overflow issue.

-	unsigned int required_size;
+	u64 required_size;
	...
	required_size = mode_cmd->pitch * mode_cmd->height;
-	if (unlikely(required_size > dev_priv->vram_size)) {
+	if (unlikely(required_size > (u64) dev_priv->vram_size)) {

Note that both pitch and height are u32.  Their product is still u32 and
would overflow before being assigned to required_size.  A correct way is
to convert pitch and height to u64 before the multiplication.

	required_size = (u64)mode_cmd->pitch * (u64)mode_cmd->height;

This patch calls the existing vmw_kms_validate_mode_vram() for
validation.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Reviewed-and-tested-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-22 12:31:02 +00:00
..
Kconfig vmwgfx: Take the driver out of staging 2011-10-11 13:06:36 +01:00
Makefile vmwgfx: Add screen object support 2011-10-05 10:17:14 +01:00
svga3d_reg.h vmwgfx: Update register files to latest from vmware-sdk 2011-10-05 10:17:08 +01:00
svga_escape.h vmwgfx: Update register files to latest from vmware-sdk 2011-10-05 10:17:08 +01:00
svga_overlay.h vmwgfx: Update register files to latest from vmware-sdk 2011-10-05 10:17:08 +01:00
svga_reg.h vmwgfx: Update register files to latest from vmware-sdk 2011-10-05 10:17:08 +01:00
svga_types.h
vmwgfx_buffer.c vmwgfx: Handle device surface memory limit 2011-10-05 10:17:31 +01:00
vmwgfx_dmabuf.c vmwgfx: Fix up query processing 2011-10-05 10:17:22 +01:00
vmwgfx_drv.c Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux 2011-11-07 10:01:56 -08:00
vmwgfx_drv.h vmwgfx: Add helper function to get surface or dmabuf 2011-12-19 14:06:02 +00:00
vmwgfx_execbuf.c Revert "drm/ttm: add a way to bo_wait for either the last read or last write" 2011-10-27 18:28:37 +02:00
vmwgfx_fb.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
vmwgfx_fence.c vmwgfx: memory leaks caused by double allocation 2011-10-18 10:41:31 +01:00
vmwgfx_fence.h vmwgfx: Add fence events 2011-10-10 15:46:55 +01:00
vmwgfx_fifo.c vmwgfx: Use the revised fifo hw version register when present 2011-12-19 14:06:00 +00:00
vmwgfx_gmr.c vmwgfx: Implement GMR2 2011-09-01 09:39:25 +01:00
vmwgfx_gmrid_manager.c vmwgfx: Restrict number of GMR pages to device limit 2011-09-01 09:38:07 +01:00
vmwgfx_ioctl.c vmwgfx: Remove dmabuf check in present ioctl 2011-12-19 14:06:01 +00:00
vmwgfx_irq.c vmwgfx: Add fence events 2011-10-10 15:46:55 +01:00
vmwgfx_kms.c vmwgfx: fix incorrect VRAM size check in vmw_kms_fb_create() 2011-12-22 12:31:02 +00:00
vmwgfx_kms.h vmwgfx: Resend the cursor after legacy modeset 2011-12-19 14:06:04 +00:00
vmwgfx_ldu.c vmwgfx: Resend the cursor after legacy modeset 2011-12-19 14:06:04 +00:00
vmwgfx_marker.c vmwgfx: Fix confusion caused by using "fence" in various places 2011-09-06 11:48:40 +01:00
vmwgfx_overlay.c vmwgfx: minor dmabuf utilities cleanup 2011-10-05 10:17:20 +01:00
vmwgfx_reg.h drm/vmwgfx: Add DRM driver for VMware Virtual GPU 2009-12-15 08:38:43 +10:00
vmwgfx_resource.c vmwgfx: Add helper function to get surface or dmabuf 2011-12-19 14:06:02 +00:00
vmwgfx_scrn.c vmwgfx: Infrastructure for explicit placement 2011-11-07 13:15:18 +00:00
vmwgfx_ttm_glue.c vmwgfx: Remove the possibility to map the fifo from user-space 2011-09-06 11:48:34 +01:00