Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6282667imu; Mon, 21 Jan 2019 06:20:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN7OuYC357ZC1oZRRZxcxwnE5D+7sidL9gWQYm0txk4Akhai+Zvdk8moWFE658djy5uVW3tJ X-Received: by 2002:a17:902:5066:: with SMTP id f35mr30491734plh.78.1548080437736; Mon, 21 Jan 2019 06:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548080437; cv=none; d=google.com; s=arc-20160816; b=SCbXwxVkptq6r7fW/jkThYM3jkgFoNH53EItLClfgMdNiQXouWc99Iy53vw9S0UVet WkgjH/Lz1yQ8/wINpR8OZV77HHMsHjOuNtOa1NCT9TCOO9pSb6ihauI8wCuTrmShc4ck ZVCe8YqXpviEEpJ8Rn0jjpuuE3SJOqRtW7skS7tagwwZ4pob9+lANxISAl9jsab1cME9 Aw8fswYmKt98rHrXjREUowd0DGVsfX0+jLVHqK2pxhpBGLRhcL5EjLp/Y3n7ScOyWUaL 6blwS3Cb+WfzqklagermHaocGgqgYqp1YhqY3Gh51xOsX21eN1fOuAZVRY3yNEihzhoS zARQ== 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=62jc0Yy5C3MhJ1SEnWcQMfpy2wNbY8RASNXg/hAwrx8=; b=hFU3GZV5UCryhn5flMtJ5ptRxwNcDdfXrDgJlamECtEMQOJzat/MZj1LlFzdxxLMsd pFI65/A+7nJE9EQsY+wo+8GSVOnNCjKWw/hSi26HbWOKLZ73P4s2GiZP4qOXb99cU1RF oMoQ6P5/9vWTRgpFTTcItxb8cAqMKf6xiefxELib2Vm1fT7ADzU5p3/iCUSdAZzZoYWI EwCqNcqQibTNRlmzV5HdN3pHm+fX8BR7H/I6bj1FeT1UUifY57M9zl6TLwri2GkiRuEL KMBOxRdfV2yMniwg9aasbsoGohzP6DD0XwRgTQFThWaqSoNtWfm9y3GR6uc50fU8GE2t a5Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="D/M8gqAX"; 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 3si12918269pla.240.2019.01.21.06.20.21; Mon, 21 Jan 2019 06:20:37 -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="D/M8gqAX"; 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 S1730636AbfAUOS1 (ORCPT + 99 others); Mon, 21 Jan 2019 09:18:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:60456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729712AbfAUNtp (ORCPT ); Mon, 21 Jan 2019 08:49:45 -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 E846220879; Mon, 21 Jan 2019 13:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548078584; bh=9OPBJRMHtMAZ2AEq59NtEzk8JJRBCGkultQqq4wz9DE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D/M8gqAXqB+Lck2eDpUoCQAY6PioRmE1i12+h02Wge4/vZvTMgs+6B2a5T0BF+2Ny 8VOOR2SP3M+zaR7+2i3wSEupXhprY0mWaaPo01tJ+NIpWsYozEDTjZJyqgg9F8vTe4 a76yBAdhE2K6cRPbjLn6/4j84IHSPHeBCE5CVqDM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+eb6e5365f23c02517dda@syzkaller.appspotmail.com, Daniel Vetter , Haneen Mohammed , Sean Paul , Daniel Vetter , Rodrigo Siqueira , Gustavo Padovan , Eric Anholt Subject: [PATCH 4.20 082/111] drm/vkms: Fix plane duplicate_state Date: Mon, 21 Jan 2019 14:43:16 +0100 Message-Id: <20190121122505.295469164@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: Daniel Vetter commit 7cdf33ab02e01300e7e6289acbac9cd8759f8712 upstream. We need to handle allocation failures and bail out. While at it, tune the allocation failures down to debug level. syzbot injected an allocation failure and then hit this WARN_ON. Reported-by: syzbot+eb6e5365f23c02517dda@syzkaller.appspotmail.com Signed-off-by: Daniel Vetter Cc: Haneen Mohammed Cc: Sean Paul Cc: Daniel Vetter Cc: Rodrigo Siqueira Cc: Gustavo Padovan Reviewed-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20181128101033.4840-1-daniel.vetter@ffwll.ch Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vkms/vkms_plane.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -23,8 +23,11 @@ vkms_plane_duplicate_state(struct drm_pl return NULL; crc_data = kzalloc(sizeof(*crc_data), GFP_KERNEL); - if (WARN_ON(!crc_data)) - DRM_INFO("Couldn't allocate crc_data"); + if (!crc_data) { + DRM_DEBUG_KMS("Couldn't allocate crc_data\n"); + kfree(vkms_state); + return NULL; + } vkms_state->crc_data = crc_data;