Skip to content

Commit 4031a51

Browse files
icklesmb49
authored andcommitted
drm: Reorder set_property_atomic to avoid returning with an active ww_ctx
BugLink: https://bugs.launchpad.net/bugs/1828410 [ Upstream commit 227ad6d ] Delay the drm_modeset_acquire_init() until after we check for an allocation failure so that we can return immediately upon error without having to unwind. WARNING: lock held when returning to user space! 4.20.0+ #174 Not tainted ------------------------------------------------ syz-executor556/8153 is leaving the kernel with locks still held! 1 lock held by syz-executor556/8153: #0: 000000005100c85c (crtc_ww_class_acquire){+.+.}, at: set_property_atomic+0xb3/0x330 drivers/gpu/drm/drm_mode_object.c:462 Reported-by: syzbot+6ea337c427f5083ebdf2@syzkaller.appspotmail.com Fixes: 144a799 ("drm: Handle properties in the core for atomic drivers") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Sean Paul <sean@poorly.run> Cc: David Airlie <airlied@linux.ie> Cc: <stable@vger.kernel.org> # v4.14+ Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181230122842.21917-1-chris@chris-wilson.co.uk Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent e4679f2 commit 4031a51

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/gpu/drm/drm_mode_object.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ static int set_property_atomic(struct drm_mode_object *obj,
465465

466466
drm_modeset_acquire_init(&ctx, 0);
467467
state->acquire_ctx = &ctx;
468+
468469
retry:
469470
if (prop == state->dev->mode_config.dpms_property) {
470471
if (obj->type != DRM_MODE_OBJECT_CONNECTOR) {

0 commit comments

Comments
 (0)