linux-rockchip/include/uapi/drm
Chris Wilson 9c1aab0da0 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-13 12:05:34 +09:00
..
drm.h drm: Kill user_modes list and the associated ioctls 2013-04-30 10:03:07 +10:00
drm_fourcc.h
drm_mode.h drm: Pad drm_mode_get_connector to 64-bit boundary 2013-11-13 12:05:34 +09:00
drm_sarea.h
exynos_drm.h drm/exynos: consider both case of vflip and hflip. 2013-01-04 15:54:33 +09:00
i810_drm.h
i915_drm.h drm/i915: Use the reloc.handle as an index into the execbuffer array 2013-01-17 22:23:47 +01:00
Kbuild drm/tegra: Add gr2d device 2013-04-22 12:40:04 +02:00
mga_drm.h
nouveau_drm.h
omap_drm.h drm/omap: move out of staging 2013-02-16 17:38:06 -05:00
qxl_drm.h drm: add new QXL driver. (v1.4) 2013-04-12 13:51:07 +10:00
r128_drm.h
radeon_drm.h drm/radeon/si: Add support for CP DMA to CS checker for compute v2 2013-10-01 09:17:47 -07:00
savage_drm.h
sis_drm.h
tegra_drm.h drm/tegra: Add gr2d device 2013-04-22 12:40:04 +02:00
via_drm.h
vmwgfx_drm.h