Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2636805lqo; Tue, 14 May 2024 05:10:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXYdvksVKOV2WEAkam8/BflG5uC1tDYBBIObsnXrbnY8VZcNhSnrWlxqRmLipmgCwglmeQRvCqiOrr2Md/dSEMQOmKBzi5rpB75WIO1w== X-Google-Smtp-Source: AGHT+IFmDJddTjNluqiP7kBd8jznDOy+8L0OfRLIjGMctTXgo1CX4V6rXACPS5VG/x9HEPRqT+gp X-Received: by 2002:a05:6e02:1a6a:b0:36c:d52:e969 with SMTP id e9e14a558f8ab-36cc1476080mr162292265ab.6.1715688626650; Tue, 14 May 2024 05:10:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715688626; cv=pass; d=google.com; s=arc-20160816; b=nC/UMGN30o0diNI0JVwZQYiBBeRnzDWfSWwaT98CPbPfbpA3AGR/zhIERIe4M8a8Sv xK/nfdkBcf9RY9b9nlyRh/4RPhdz6KYLW53BbcI8vPTN+o9HuIRQ6QlGQIAmeEGJa35N KNYtMmvkGiB62+5q9ENFnWCs5oZW/XIt67AYU9dUHjhDHDo4O68gWhMIJC2jNgT9GqW2 7KSNXLuaB/NCgzG6xcYU2E3QJdG1C9vPByjwUbExjREURvh8KBDsVQ53mSbsIjZJglK4 0SvytXCOmPqJ+DY5/5Avp1TbaMZvoCdLfyPWFXwYWiffAQzJe+oRBHW1feYgo85pBLtL FT/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=sZrp5p1YBrqHcXgp4Pxz/RUyePTwWNkLqLA4FbPwqEQ=; fh=Rm//mzDvQ8SndWjxU58ecjLenbm2TohOAxyHYhC4DW4=; b=gyNRGvCpUlQAjpm2QmT2EBEeWrj3KSLx4ltHEn6erClXKlXaINqWJGRblK5beVjiR1 kflIo7JHeIXGDYdHWIpgSPgBQrq2w5AALqJcVnubU3fV7MZRZTNyg4tYuWzArcsRHCPp /bDdH+mjAjELOeZD8b5gSwwm/CTAH93uRa981XTE+zEvAT1AR2ef43AYy8i9uS5JAB39 kA3Q8ZA94ys1kJdBS0s9WP1jrGGs44rnmgRQy695luHOqgRN13RA+iiFaiJjIypq5DSH iS7soRQ3WCfUw1YR7b2USrtd9Y6b3pQIL2AQPv/oYELXm5IEGgQDqWKtEJrwW52BQnjO +Y0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oX1h94jR; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-178632-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178632-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6340b2a07basi11161083a12.194.2024.05.14.05.10.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 05:10:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178632-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oX1h94jR; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-178632-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178632-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0025E28DCAB for ; Tue, 14 May 2024 11:59:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99F793B79C; Tue, 14 May 2024 11:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="oX1h94jR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB4EFF9D4; Tue, 14 May 2024 11:59:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715687953; cv=none; b=rIAC9fcHjaGqH6IaUGRiKgqedM624+wK81O3VF6s7t7n9s0bsBE5T6wQtFKPpn8fCEqZNQsRiAJe8TV9aWYZtVm+x8mU7u/C2tSIUyvxuBJpJqqYPEmLXerKM+u1Gz4BIdUd3ZGk9pIsB9sOwOlYr0hbi6I1CzT3dzHvz5V0JEM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715687953; c=relaxed/simple; bh=g2IbNihOtzpOb1bCRRWE5U/uOcIpNeClRG+bPOVV1Po=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z1UrNRulhz3k2oewF3FqAyIRE/QZvmrevlIlneIR7hylZRq+mk43d6HA0eL9nSv+HR6jv5P3CbJBc37WOAlKB/24ZoXUG663CfTNUluTeBgKOvQmsV2mZ1OtjLYThfly98Iagpv9x+oEj+jNr//YFcqIgkxyJhdT5yrz2NC6rUk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oX1h94jR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A01FC2BD10; Tue, 14 May 2024 11:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715687953; bh=g2IbNihOtzpOb1bCRRWE5U/uOcIpNeClRG+bPOVV1Po=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oX1h94jRJ6e3uuVGJGcL/zddfRRgG76XhTy7ikuFl2xN1eIaNesbwDp8aL73sg0jo rgkq4BXJ2xgJKT7o/X1pk+Hs8xOMdOytO6Jw2NZuJA8IZcik41jJnQ8WhR40dFWU4U mTi7FP1tJIEYXdfkaZmuQcqvkC9UjOmmmkhmEUfM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zack Rusin , David Airlie , Daniel Vetter , Broadcom internal kernel review list , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maaz Mombasawala , Martin Krastev , zdi-disclosures@trendmicro.com Subject: [PATCH 5.15 162/168] drm/vmwgfx: Fix invalid reads in fence signaled events Date: Tue, 14 May 2024 12:21:00 +0200 Message-ID: <20240514101012.872812793@linuxfoundation.org> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514101006.678521560@linuxfoundation.org> References: <20240514101006.678521560@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zack Rusin commit a37ef7613c00f2d72c8fc08bd83fb6cc76926c8c upstream. Correctly set the length of the drm_event to the size of the structure that's actually used. The length of the drm_event was set to the parent structure instead of to the drm_vmw_event_fence which is supposed to be read. drm_read uses the length parameter to copy the event to the user space thus resuling in oob reads. Signed-off-by: Zack Rusin Fixes: 8b7de6aa8468 ("vmwgfx: Rework fence event action") Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-23566 Cc: David Airlie CC: Daniel Vetter Cc: Zack Rusin Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Cc: # v3.4+ Reviewed-by: Maaz Mombasawala Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20240425192748.1761522-1-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c @@ -1068,7 +1068,7 @@ static int vmw_event_fence_action_create } event->event.base.type = DRM_VMW_EVENT_FENCE_SIGNALED; - event->event.base.length = sizeof(*event); + event->event.base.length = sizeof(event->event); event->event.user_data = user_data; ret = drm_event_reserve_init(dev, file_priv, &event->base, &event->event.base);