Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2609413lqo; Tue, 14 May 2024 04:16:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW0fh0VXuCPUOrjdieYfOkpp+WToJ95H93uL7CmKZgb8vQfQg662juj8Fpi7bNbV9ZyigCqxbmmXeHz930jX8/js+EQLCcim/GgswnGuw== X-Google-Smtp-Source: AGHT+IEC3RVZKth3MERXHqRHau4NcRexoCJAIxahnZgSNlIkYIX6YD3nM5F0AY8xMEqHhFdeo/Hc X-Received: by 2002:a17:906:3184:b0:a5a:1579:9033 with SMTP id a640c23a62f3a-a5a2d53abacmr739440066b.1.1715685375098; Tue, 14 May 2024 04:16:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715685375; cv=pass; d=google.com; s=arc-20160816; b=TMLimcXZb7j+CGzKwJ3HsddZ4EaGNlP/pe+WQUojCuFDwP37e/81P4MVeL2RgtpNxa wggN4IahzRq9t+25mM2egUl4OVjkBQrvlilomsTDF21drclzrPtmWObBulWMnngBDKnv eiEIVOQ12stmVX7eIhGmaqgZHxlXUxCbnXxrTXsFejzcGkvRT3aBNXOpBStv/xHXxcyO bd/ndtSE5VgvrtxTvDoj7kPCnw4xmfFsqs0jOS3q0boITQtVY1tfTWguUaB4Jyfb9CsD +Y/CodUnWx+/opGzLLm5kE9+9rS2baepDfWcLHKzu3XkRZVmQ3chzDptUvSMNtZkk9lI dKjA== 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=x6CMUr0I5pDEQWalhQb2xlrkZS9uJa3zxBuvTDb7cIk=; fh=Rm//mzDvQ8SndWjxU58ecjLenbm2TohOAxyHYhC4DW4=; b=ZWIc8gSfWRcHpDwXV7a/CB/l8UVfVMVN0fuwvZ1ZVOO0vQJAer8g2xFv2xYVbWXUZO f9MLTNwx+Xv2QH9GnbUf3x8zqb7Bn0eqq0C8fqnDiU7xkb/NHC7EdFLVn5XvDC9/o7Zj XPHUTK3Rvnl3B4AFvs7aZj8AQjuHDf0wjaFqWmnK5qIlyRhvb1toeccwJYnpGorDAI7t jg2ZWD/EsHjnF21tMu5q+GmXpGl0ZOAt1GLJFn/sTn4Ymnc23yTY8flvtDBp/AsdiCnD fmqvi7ARjLxwjYwRtX/U3QDBW7LE7VezuJY8AbIRrluBcS8hfafiicdmSHkcyRxHtGEA AorA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dG7X0fjW; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-178578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178578-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a89dd4c2fsi37575566b.107.2024.05.14.04.16.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 04:16:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dG7X0fjW; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-178578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178578-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BF0BB1F21EFA for ; Tue, 14 May 2024 11:16:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3559012C54A; Tue, 14 May 2024 10:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="dG7X0fjW" 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 578B16CDC9; Tue, 14 May 2024 10:52:25 +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=1715683945; cv=none; b=kb4vmKVPHFVAUkV0PSoQORzWzK3BLXlfprfTp4n+RO3ue/S8d5y/sy3m5HHO6A9f/aVq16jo9CTllX0F0buHmO2lVIWz/kvrl/I+MezAU9NyCCmXx3JSbew3C6LPltkmlsNftLlbf/xUOzzBfCsIbT/WK7NfpG1W76YKBw1tOEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715683945; c=relaxed/simple; bh=HzymojR6eANGvMHbiOBc1AW1r5RLyDAKnqpjyv7pRuY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZEoIabHc5ipf4BXmgaUxQ0zqw3xCrmaipHJNXCfWAqPngAy600wDxTG0BkpSrWEkfq2vS6NW9elYBzXHYk9Fg/mJ8EZXy19J0ZSJtsSAB8vV3wz1oPkhaunxntCeirEoQ/hMPPFy9/n5UCWgongvFSXeZpDxfQByWJYkDRQErmc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dG7X0fjW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF74CC2BD10; Tue, 14 May 2024 10:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715683945; bh=HzymojR6eANGvMHbiOBc1AW1r5RLyDAKnqpjyv7pRuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dG7X0fjWLIhkKP47Q7YVpSi0iPxjnDGHPo/swQyKWkZVbB11/p03gw0KxOIBR0pYx 6iawGyxnaviV5V1ok6U7F4i6T17TJw5h1WuLjVV79kYGGe/LtJzNR0EXceBigD4AGv 5AF9MzCatfHEgz7Ps7vxME6QyO1YOKDu+EYpyhME= 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 6.8 298/336] drm/vmwgfx: Fix invalid reads in fence signaled events Date: Tue, 14 May 2024 12:18:22 +0200 Message-ID: <20240514101049.868407347@linuxfoundation.org> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514101038.595152603@linuxfoundation.org> References: <20240514101038.595152603@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 6.8-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 @@ -991,7 +991,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);