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 4C57BC282CE for ; Tue, 4 Jun 2019 12:37:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06754240B7 for ; Tue, 4 Jun 2019 12:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559651877; bh=RrgG4nfjRm6kwfZmokGdV4DolkJdtuRmu2NWj2tug6s=; h=Subject:To:Cc:From:Date:List-ID:From; b=fNx9f707a+I3/FEmlowBsl21Qta4qfM51rtOXAfLEU7wOUBBOGO46w6oOkK5t+X+J CbEGy8CBLOM87n6olbTxeCiARMCtH3LxJ7dJQA2zOSyyfcUuMIUirFyBUGhS8FEC4G c0LJ7vpVRuotLNqHUwBFrByIFmh15qDoGomPQ0Ks= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727726AbfFDMh4 (ORCPT ); Tue, 4 Jun 2019 08:37:56 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:44563 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727403AbfFDMh4 (ORCPT ); Tue, 4 Jun 2019 08:37:56 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 55C7A2203E; Tue, 4 Jun 2019 08:37:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 04 Jun 2019 08:37:55 -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=rXcNhe bL6XeA2ObVKjhfvytKUD/TYUVQPS0XDvDckiY=; b=JVCG2cDuyKjxueXl+q9iEB 0d+AKX/mHzAljmWC1kfBdKXx5qCVe4rQ81V5Nl8EHZRnTDJvqllWsD6jOZOrsGIb CGjeGVJ68F7ACHl3/PQ7eMXk4bpcEcIQHSKDGf/ZKtuKdydlxkHu6tXL15urwVKp C6Mgz9sbqxeCq5y0w+eimwuY/25QhRCXuPeXMRap7K0gpGEGE6QhXEBeUMxgHqwU yJNPUHoZugzsb69DUvaj5TfzrP7Ve3h5VkA7xLy3zt1/T8iEDEEJOY33bzuwFdZn /OEzYIJcqXfP+Sq7tzokpVdV7ST9ihb1vUEMWqtm87ake31PB6tLryLxyMkAk9Hw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudefledgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomh epghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgepvd 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 B90D2380085; Tue, 4 Jun 2019 08:37:54 -0400 (EDT) Subject: FAILED: patch "[PATCH] drm/vmwgfx: NULL pointer dereference from" failed to apply to 4.4-stable tree To: murray.mcallister@gmail.com, stable@vger.kernel.org, thellstrom@vmware.com Cc: From: Date: Tue, 04 Jun 2019 14:37:41 +0200 Message-ID: <155965186186230@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.4-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);