android_kernel_google_msm/include/drm
Chris Wilson 465282b316 drm: Pad drm_mode_get_connector to 64-bit boundary
commit bc5bd37ce4 upstream.

Pavel Roskin reported that DRM_IOCTL_MODE_GETCONNECTOR was overwritting
the 4 bytes beyond the end of its structure with a 32-bit userspace
running on a 64-bit kernel. This is due to the padding gcc inserts as
the drm_mode_get_connector struct includes a u64 and its size is not a
natural multiple of u64s.

64-bit kernel:

sizeof(drm_mode_get_connector)=80, alignof=8
sizeof(drm_mode_get_encoder)=20, alignof=4
sizeof(drm_mode_modeinfo)=68, alignof=4

32-bit userspace:

sizeof(drm_mode_get_connector)=76, alignof=4
sizeof(drm_mode_get_encoder)=20, alignof=4
sizeof(drm_mode_modeinfo)=68, alignof=4

Fortuituously we can insert explicit padding to the tail of our
structures without breaking ABI.

Reported-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Weng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-07 16:02:13 -07:00
..
i2c
ttm BUG: headers with BUG/BUG_ON etc. need linux/bug.h 2012-03-04 17:54:34 -05:00
drm.h drm: base prime/dma-buf support (v5) 2012-03-30 11:52:44 +01:00
drm_buffer.h
drm_cache.h
drm_core.h
drm_crtc.h drm: allow loading an EDID as firmware to override broken monitor 2012-03-20 10:09:28 +00:00
drm_crtc_helper.h
drm_dp_helper.h
drm_edid.h drm: allow loading an EDID as firmware to override broken monitor 2012-03-20 10:09:28 +00:00
drm_encoder_slave.h
drm_fb_helper.h
drm_fixed.h
drm_fourcc.h
drm_global.h
drm_hashtab.h
drm_mem_util.h
drm_memory.h
drm_mm.h
drm_mode.h drm: Pad drm_mode_get_connector to 64-bit boundary 2014-06-07 16:02:13 -07:00
drm_os_linux.h
drm_pciids.h drm/radeon: 0x9649 is SUMO2 not SUMO 2014-01-08 09:42:11 -08:00
drm_sarea.h
drm_sysfs.h
drm_usb.h
drmP.h drm: base prime/dma-buf support (v5) 2012-03-30 11:52:44 +01:00
exynos_drm.h drm/exynos: fixed exynos broken ioctl 2012-04-12 16:42:54 +09:00
gma_drm.h gma500: fix ioctl confict 2012-03-10 13:06:04 +00:00
i810_drm.h
i915_drm.h
intel-gtt.h drm/i915: disable ppgtt on snb when dmar is enabled 2012-04-02 15:59:07 +02:00
Kbuild drm/exynos: exynos_drm.h header file fixes 2012-02-15 10:29:12 +09:00
mga_drm.h
nouveau_drm.h
r128_drm.h
radeon_drm.h drm/radeon/kms: add support for the CONST IB to the CS ioctl 2012-03-21 06:55:53 +00:00
savage_drm.h
sis_drm.h
via_drm.h
vmwgfx_drm.h