linux/drivers/gpu/drm
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
..
exynos drm/exynos: fixed wrong err ptr usage and destroy call in exeception 2011-11-17 10:05:39 +09:00
i2c gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
i810 gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
i915 Revert "drm/i915: fix infinite recursion on unbind due to ilk vt-d w/a" 2011-12-16 12:58:39 -08:00
mga gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
nouveau drm/nv50/disp: silence compiler warning 2011-11-30 23:43:55 +10:00
r128 gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
radeon drm/radeon/kms: bail on BTC parts if MC ucode is missing 2011-12-22 12:28:01 +00:00
savage gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
sis gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
tdfx gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
ttm ttm: Don't return the bo reserved on error path 2011-11-22 20:06:21 +00:00
via gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
vmwgfx vmwgfx: fix incorrect VRAM size check in vmw_kms_fb_create() 2011-12-22 12:31:02 +00:00
ati_pcigart.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_agpsupport.c
drm_auth.c
drm_buffer.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_bufs.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_cache.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_context.c
drm_crtc.c drm: integer overflow in drm_mode_dirtyfb_ioctl() 2011-11-23 08:59:28 +00:00
drm_crtc_helper.c drm: Fix lack of CRTC disable for drm_crtc_helper_set_config(.fb=NULL) 2011-12-02 10:47:15 +00:00
drm_debugfs.c drm: serialize access to list of debugfs files 2011-11-11 11:05:19 +00:00
drm_dma.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_dp_i2c_helper.c
drm_drv.c drm: do not sleep on vblank while holding a mutex 2011-11-11 11:12:47 +00:00
drm_edid.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_edid_modes.h
drm_encoder_slave.c gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
drm_fb_helper.c gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
drm_fops.c gpu: add module.h to drivers/gpu files as required. 2011-10-31 19:32:03 -04:00
drm_gem.c drm/gem: add functions for mmap offset creation 2011-08-30 11:06:06 +01:00
drm_global.c
drm_hashtab.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_info.c
drm_ioc32.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_ioctl.c
drm_irq.c drm: Remove utterly bogus preempt_disable() sections 2011-11-14 09:28:50 +00:00
drm_lock.c
drm_memory.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_mm.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_modes.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_pci.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_platform.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_proc.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_scatter.c drivers: use kzalloc/kcalloc instead of 'kmalloc+memset', where possible 2011-07-25 20:57:13 -07:00
drm_sman.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_stub.c
drm_sysfs.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_trace.h
drm_trace_points.c
drm_usb.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
drm_vm.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
Kconfig drm: fix kconfig unmet dependency warning 2011-11-11 11:23:09 +00:00
Makefile DRM: add DRM Driver for Samsung SoC EXYNOS4210. 2011-10-05 10:27:31 +01:00
README.drm

************************************************************
* For the very latest on DRI development, please see:      *
*     http://dri.freedesktop.org/                          *
************************************************************

The Direct Rendering Manager (drm) is a device-independent kernel-level
device driver that provides support for the XFree86 Direct Rendering
Infrastructure (DRI).

The DRM supports the Direct Rendering Infrastructure (DRI) in four major
ways:

    1. The DRM provides synchronized access to the graphics hardware via
       the use of an optimized two-tiered lock.

    2. The DRM enforces the DRI security policy for access to the graphics
       hardware by only allowing authenticated X11 clients access to
       restricted regions of memory.

    3. The DRM provides a generic DMA engine, complete with multiple
       queues and the ability to detect the need for an OpenGL context
       switch.

    4. The DRM is extensible via the use of small device-specific modules
       that rely extensively on the API exported by the DRM module.


Documentation on the DRI is available from:
    http://dri.freedesktop.org/wiki/Documentation
    http://sourceforge.net/project/showfiles.php?group_id=387
    http://dri.sourceforge.net/doc/

For specific information about kernel-level support, see:

    The Direct Rendering Manager, Kernel Support for the Direct Rendering
    Infrastructure
    http://dri.sourceforge.net/doc/drm_low_level.html

    Hardware Locking for the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/hardware_locking_low_level.html

    A Security Analysis of the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/security_low_level.html