Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6281512imu; Mon, 21 Jan 2019 06:19:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN4QWABzSVuocQM2Gigrc6CfUo1YYGE1WbS8Pq9F2L5IMBhf+dHbtW61vcC8l4ZeVrN1SmUC X-Received: by 2002:a63:dd15:: with SMTP id t21mr27135971pgg.347.1548080373839; Mon, 21 Jan 2019 06:19:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548080373; cv=none; d=google.com; s=arc-20160816; b=RuyoZ5SkJAO01Kyw/Dpbuutr97tXj2nyPhcGjayQXDxg4Xh33fn5Wa5Z4TGmQS1nln 5yenPhQNQqtLeFKpU8KGCYYoMIqZZSQempuEWOONUwk9AABHZM04t68A1tVis80W74He vR1YRQdK7yPJCSv18yXvVZBdmKbjrBxGvXEfBhdaqZzjqbtna/V75EfFGVK2DzF3mC0N qUCJGXEVovxGschDdLyQV1C8JoQEYuqa/0/n+vkG7fcAHQHXJHxC++FsNDIrjz8VvO9u rL1fS9XJnvpfgtNOwW10weUPWciKUL3iOwIXVo4Rr3gH1fFdY2vJAsFuXY1dOa/DXjIY itKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XpiZnpGCTRXqYY3SI8nea2iLHE/T5O9zTZvd3JzsPT8=; b=ZYHfzvH2McgXTTr6WqE+e4T4ghRlKb4r+D+oK3GWsvMoLEF4VUk8oMKnMBbyTq0BWc 3MA0cVZaCnMz17UJ7KeNukDTeNfXP9Q4bkBeCOYjDo6i7tkAiEtwidkSc4bJQNYnBmmd 4GAV5f/L5bKsM1HyGSHGR+AT1v+7czEvcE34BgqC+Ia7SC3cR2ifDFAGO4MqeUU/NaoH ritU7aNBHkERwkp1jLfPBKttao5YQQvuQbU7GUhoDyZeWE5iFdgl1/2Jfaen+RVNYcby 99f0e2sqSdDwta32W7O7+DS6VrWW+Ryy+kTwFDv4jeOx9tNE/pTbvtvvY32sEJN49ZzN Nm/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="QLYo6/Dl"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si12446604plf.370.2019.01.21.06.19.18; Mon, 21 Jan 2019 06:19:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="QLYo6/Dl"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730390AbfAUNtw (ORCPT + 99 others); Mon, 21 Jan 2019 08:49:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:60514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730367AbfAUNts (ORCPT ); Mon, 21 Jan 2019 08:49:48 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 37FD720861; Mon, 21 Jan 2019 13:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548078587; bh=iNVnNxpfeo3ByFL8eOXJofTcKhfmNRWl+w3xK9mmnBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QLYo6/DlNYTuVQQjn/Szwt35ARN5NVGiL6Wk6a8rxwzXnWpO5wBeUCLUkzc3e4SLm g7qoouZ7BIVEWpAtMsL5JxSPnNXP5K+qlSOcsb8BDrh59id5aHsRmLzqawRioXFYmT jHOYcUeF065ViI/h0ZKu4jViMZw57J20uy2onL0I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tetsuo Handa , syzbot , Daniel Vetter Subject: [PATCH 4.20 083/111] gpu/drm: Fix lock held when returning to user space. Date: Mon, 21 Jan 2019 14:43:17 +0100 Message-Id: <20190121122505.377836532@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121122455.819406896@linuxfoundation.org> References: <20190121122455.819406896@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tetsuo Handa commit 4089e272ac61603931beb024d4d640de2cb390e0 upstream. We need to call drm_modeset_acquire_fini() when drm_atomic_state_alloc() failed or call drm_modeset_acquire_init() after drm_atomic_state_alloc() succeeded. Signed-off-by: Tetsuo Handa Reported-by: syzbot Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1547115571-21219-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_atomic_uapi.c | 3 +-- drivers/gpu/drm/drm_mode_object.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -1275,12 +1275,11 @@ int drm_mode_atomic_ioctl(struct drm_dev (arg->flags & DRM_MODE_PAGE_FLIP_EVENT)) return -EINVAL; - drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE); - state = drm_atomic_state_alloc(dev); if (!state) return -ENOMEM; + drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE); state->acquire_ctx = &ctx; state->allow_modeset = !!(arg->flags & DRM_MODE_ATOMIC_ALLOW_MODESET); --- a/drivers/gpu/drm/drm_mode_object.c +++ b/drivers/gpu/drm/drm_mode_object.c @@ -458,11 +458,11 @@ static int set_property_atomic(struct dr struct drm_modeset_acquire_ctx ctx; int ret; - drm_modeset_acquire_init(&ctx, 0); - state = drm_atomic_state_alloc(dev); if (!state) return -ENOMEM; + + drm_modeset_acquire_init(&ctx, 0); state->acquire_ctx = &ctx; retry: if (prop == state->dev->mode_config.dpms_property) {