summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.com>2017-01-13 12:22:09 -0200
committerGustavo Padovan <gustavo.padovan@collabora.com>2017-01-16 20:00:54 -0200
commit7e9081c5aac73b8a0bc22e0b3e7a12c3e9cf5256 (patch)
tree44fbde9719a4eaa462447e2049f30fd1e408bb0c /include/drm
parent3846fd9b86001bea171943cc3bb9222cb6da6b42 (diff)
downloadtalos-obmc-linux-7e9081c5aac73b8a0bc22e0b3e7a12c3e9cf5256.tar.gz
talos-obmc-linux-7e9081c5aac73b8a0bc22e0b3e7a12c3e9cf5256.zip
drm/fence: fix memory overwrite when setting out_fence fd
Currently if the userspace declares a int variable to store the out_fence fd and pass it to OUT_FENCE_PTR the kernel will overwrite the 32 bits above the int variable on 64 bits systems. Fix this by making the internal storage of out_fence in the kernel a s32 pointer. Reported-by: Chad Versace <chadversary@chromium.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com> Fixes: beaf5af48034 ("drm/fence: add out-fences support") Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Rafael Antognolli <rafael.antognolli@intel.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-and-Tested-by: Chad Versace <chadversary@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1484317329-9293-1-git-send-email-gustavo@padovan.org
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_atomic.h2
-rw-r--r--include/drm/drm_mode_config.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index d6d241f63b9f..56814e8ae7ea 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -144,7 +144,7 @@ struct __drm_crtcs_state {
struct drm_crtc *ptr;
struct drm_crtc_state *state;
struct drm_crtc_commit *commit;
- s64 __user *out_fence_ptr;
+ s32 __user *out_fence_ptr;
};
struct __drm_connnectors_state {
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index bf9991b20611..137432386310 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -488,7 +488,7 @@ struct drm_mode_config {
/**
* @prop_out_fence_ptr: Sync File fd pointer representing the
* outgoing fences for a CRTC. Userspace should provide a pointer to a
- * value of type s64, and then cast that pointer to u64.
+ * value of type s32, and then cast that pointer to u64.
*/
struct drm_property *prop_out_fence_ptr;
/**
OpenPOWER on IntegriCloud