Patch "drm: Pad drm_mode_get_connector to 64-bit boundary" has been added to the 3.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm: Pad drm_mode_get_connector to 64-bit boundary

to the 3.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-pad-drm_mode_get_connector-to-64-bit-boundary.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 2afe1a102cd3962ed4ec683128765fd33a4ab666 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Date: Wed, 16 Oct 2013 09:49:02 +0100
Subject: drm: Pad drm_mode_get_connector to 64-bit boundary

From: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>

commit bc5bd37ce48c66e9192ad2e7231e9678880f6f8e 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@xxxxxxx>
Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Dave Airlie <airlied@xxxxxxxxxx>
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Dave Airlie <airlied@xxxxxxxxxx>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
Cc: Weng Meiling <wengmeiling.weng@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 include/drm/drm_mode.h |    2 ++
 1 file changed, 2 insertions(+)

--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -223,6 +223,8 @@ struct drm_mode_get_connector {
 	__u32 connection;
 	__u32 mm_width, mm_height; /**< HxW in millimeters */
 	__u32 subpixel;
+
+	__u32 pad;
 };
 
 #define DRM_MODE_PROP_PENDING	(1<<0)


Patches currently in stable-queue which might be from chris@xxxxxxxxxxxxxxxxxx are

queue-3.4/drm-i915-only-increment-the-user-pin-count-after-successfully-pinning-the-bo.patch
queue-3.4/drm-i915-add-missing-n-to-uts_release-in-the-error_state.patch
queue-3.4/drm-i915-sdvo-clean-up-connectors-on-intel_sdvo_init-failures.patch
queue-3.4/drm-i915-workaround-incoherence-between-fences-and-llc-across-multiple-cpus.patch
queue-3.4/drm-i915-panel-invert-brightness-via-parameter.patch
queue-3.4/drm-i915-dump-uts_release-into-the-error_state.patch
queue-3.4/drm-i915-close-race-between-processing-unpin-task-and-queueing-the-flip.patch
queue-3.4/drm-i915-panel-invert-brightness-acer-aspire-5734z.patch
queue-3.4/drm-i915-panel-invert-brightness-via-quirk.patch
queue-3.4/drm-pad-drm_mode_get_connector-to-64-bit-boundary.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]