]> git.baikalelectronics.ru Git - kernel.git/commit
drm/fence: fix memory overwrite when setting out_fence fd
authorGustavo Padovan <gustavo.padovan@collabora.com>
Fri, 13 Jan 2017 14:22:09 +0000 (12:22 -0200)
committerGustavo Padovan <gustavo.padovan@collabora.com>
Mon, 16 Jan 2017 22:00:54 +0000 (20:00 -0200)
commitbadcf131701a97520fdae4a2b80eaa1e557982ec
tree44fbde9719a4eaa462447e2049f30fd1e408bb0c
parente3cd17da1990753f6b1eab7d184086ed51a99a69
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: 83081235d656 ("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
drivers/gpu/drm/drm_atomic.c
include/drm/drm_atomic.h
include/drm/drm_mode_config.h