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 DAF99C282CE for ; Tue, 4 Jun 2019 12:37:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1F60240B7 for ; Tue, 4 Jun 2019 12:37:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559651872; bh=gYKI1kPFLQfxXHEna8JeLhQ5j2xgfpPurVa/wCr8CD8=; h=Subject:To:Cc:From:Date:List-ID:From; b=aKR1wKVeRzfXoVYK0acb26FdIa89aaPoLW4PIMMVULnpoCFYl+u2ngvCZbjz0rRzw vV6uYpR+FeYuOPWFDA+7TPcLvyI1dmmI178Nn3KrQuIdt/CgA10s/pVfxo+NiYt6Zi vL/gBPqQSv0eb+RkmgY3gAmj1frOgXedxawlRPjA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727732AbfFDMhw (ORCPT ); Tue, 4 Jun 2019 08:37:52 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:38405 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727723AbfFDMhw (ORCPT ); Tue, 4 Jun 2019 08:37:52 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E6B2321FC1; Tue, 4 Jun 2019 08:37:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 04 Jun 2019 08:37:50 -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=FT6P+0 1rCT5mMs83i5CbYq0RBA9Pve3Gb65hB/r4I4A=; b=YqIT1NJQZMayVniH+OSK0c NUo+F0xGtSIECRr/p09AuYrPHf+foVhFiyamuDwgUPVy6DLh3+nPgwsLm5Q8bS+V OG/lCcnmmxfQLgRBEIS1fjP7/G3a6YH1mqBf96Gx/VZFDIs9OSrkQGnaD49RxlvI 5iwM4qye6JPe77WRte/4rTHxN4XJAsq5oTVRHsWl1JPeWc/4/DRXxWglAKw/4IG2 l8a81B7hMZW6qhfApYGnnQxIVeonROmDTNQ1JzGVpI43diDC/lIeBVDoLA/auMOc M5fFe4avqZtlW6Ugq5hp5wY5ZXLuTzuoMI+cRxvrH8xYNheDQ+8VnLUor8BwWGRg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudefledgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomh epghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgepud 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 6A64C380084; Tue, 4 Jun 2019 08:37:49 -0400 (EDT) Subject: FAILED: patch "[PATCH] drm/vmwgfx: NULL pointer dereference from" failed to apply to 4.14-stable tree To: murray.mcallister@gmail.com, stable@vger.kernel.org, thellstrom@vmware.com Cc: From: Date: Tue, 04 Jun 2019 14:37:40 +0200 Message-ID: <155965186089208@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 4.14-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);