From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9795BC282CE for ; Tue, 4 Jun 2019 12:37:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D96F240B7 for ; Tue, 4 Jun 2019 12:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559651864; bh=ydTKa3A671DVwp9nA7+3tJsUcM7QWFBV1Vj9SJg3phs=; h=Subject:To:Cc:From:Date:List-ID:From; b=HMr6Mg5/f2N0sWcw6fFYvOr95g7pR0ocJ6GKUvz2bTsc+dOVULlkblQEFHvgr/W+6 8wUQHyYD/SSABb7fegMzRP8qYyVkiscn5r+urGx9T1JXVlwtbGorLpaYIYOEGjVrYO p9i7G9h82vPQKuGYl0ZuNOmRBwpJzQ/AQeZtHQeY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbfFDMhn (ORCPT ); Tue, 4 Jun 2019 08:37:43 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:54029 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727403AbfFDMhn (ORCPT ); Tue, 4 Jun 2019 08:37:43 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 34558220D5; Tue, 4 Jun 2019 08:37:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 04 Jun 2019 08:37:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=2GTCww PCR1rdKdHhuCeWUoEQ6nOnqeUoKgM7F//1stc=; b=3ItE6OUyoXMzF+d9D0rBNu XNUvRPAGLicz0VOpeHqwXwA80/rs2FaPBfJmY2L/LGwp1ymAJTqv63REylqIPFv9 GQouFkdGsZWUUuRze7mWKi6ab7zudFaP+9+IT0u/Ks+z01t4j4D+DhMkdAlzAw49 wzcVg6d/dDJFxsmuiHIrplnwiEQbCNIO0GSNrL/RZrONF0RTRJtpm9PWV0x2kGTe m/1NyxDAWTPLzy/SpDXXhRSvPByjaFLAqf9yLgLSKVljGa3CpA+NzN7bqsUybpyE Bv0XUt41AXzRyRhNSkd58mRKffamRYt0C9a0eZsOSFhNMNQq/97dgyMqZKXHVDLg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudefledgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomh epghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 85AA6380089; Tue, 4 Jun 2019 08:37:41 -0400 (EDT) Subject: FAILED: patch "[PATCH] drm/vmwgfx: NULL pointer dereference from" failed to apply to 5.1-stable tree To: murray.mcallister@gmail.com, stable@vger.kernel.org, thellstrom@vmware.com Cc: From: Date: Tue, 04 Jun 2019 14:37:39 +0200 Message-ID: <1559651859755@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From bcd6aa7b6cbfd6f985f606c6f76046d782905820 Mon Sep 17 00:00:00 2001 From: Murray McAllister Date: Sat, 11 May 2019 18:01:37 +1200 Subject: [PATCH] drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define() If SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW is called with a surface ID of SVGA3D_INVALID_ID, the srf struct will remain NULL after vmw_cmd_res_check(), leading to a null pointer dereference in vmw_view_add(). Cc: Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support") Signed-off-by: Murray McAllister Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 315f9efce765..b4c7553d2814 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -2427,6 +2427,10 @@ static int vmw_cmd_dx_view_define(struct vmw_private *dev_priv, return -EINVAL; cmd = container_of(header, typeof(*cmd), header); + if (unlikely(cmd->sid == SVGA3D_INVALID_ID)) { + VMW_DEBUG_USER("Invalid surface id.\n"); + return -EINVAL; + } ret = vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface, VMW_RES_DIRTY_NONE, user_surface_converter, &cmd->sid, &srf);