Commit 45723728 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Jani Nikula

drm/core: Fix old_fb handling in drm_mode_atomic_ioctl.

plane_mask should be cleared inside the retry loop, because it gets
reset on every retry. Without this fix the plane->fb refcounting might
get out of sync on retries, resulting in either leaked memory or
use-after-free.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: stable@vger.kernel.org #v4.3
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1447237751-9663-3-git-send-email-maarten.lankhorst@ubuntu.com
parent 24e79d0d
...@@ -1446,7 +1446,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev, ...@@ -1446,7 +1446,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
struct drm_plane *plane; struct drm_plane *plane;
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state; struct drm_crtc_state *crtc_state;
unsigned plane_mask = 0; unsigned plane_mask;
int ret = 0; int ret = 0;
unsigned int i, j; unsigned int i, j;
...@@ -1486,6 +1486,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev, ...@@ -1486,6 +1486,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
state->allow_modeset = !!(arg->flags & DRM_MODE_ATOMIC_ALLOW_MODESET); state->allow_modeset = !!(arg->flags & DRM_MODE_ATOMIC_ALLOW_MODESET);
retry: retry:
plane_mask = 0;
copied_objs = 0; copied_objs = 0;
copied_props = 0; copied_props = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment