Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2638689lqo; Tue, 14 May 2024 05:13:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbqExmW4nsw5f66anPYJUABq4IuRYghkh8xo7+CvjhGMq3N5YZnfzuL9wxGgdmHpgSpK3GxGOmEp/ifmy02Ig8rDerzvQc6rq1xf8iog== X-Google-Smtp-Source: AGHT+IFfLk9ONwNnTF6x8Q0bqQ+FAsCbueygmCdo/n1ltmdeYIhVciiMvBdJWR7aBnFb9vWZUeOi X-Received: by 2002:a05:6a20:6f87:b0:1af:df82:99a3 with SMTP id adf61e73a8af0-1afdf829a74mr13658804637.17.1715688814590; Tue, 14 May 2024 05:13:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715688814; cv=pass; d=google.com; s=arc-20160816; b=V+wLJfq60vx8zd15cGSZl2BHafNcy8lNlwqVYUz60FhTcTW+UgGfLRvYZOb/2D1tUT bMuJWv42JZZS1lt+yXDFdYFM86PjY8VnfcOs8ip+MdZQ1XgoSynkscH3muipgm2TTYOT kcSiQGFkjf9DwZ5uHNJQPR7dFcZDVVoX5xmcF27qeM/bwLBctSFPaLDlgmkN1U0khce1 lr87FTZSiVq5YeM7JuUeC6rlBJayD6yvJgMXxjWyFH5QjInTLsxAAOiOxUUqk8ytGwX0 SmQs96maMILJT9PYDkLTYKnp/qGroOIlaOZbq/VtVoIOtmzAAU2viV0TiOGfGAvT4bgu 0XcQ== 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=mxRmSpA9VdcHN3LKv4NQbHBKHba12RLTTEdCeUwdae0=; fh=Rm//mzDvQ8SndWjxU58ecjLenbm2TohOAxyHYhC4DW4=; b=NClrCmO3cMc6MQ9cSQNoQV3w5EqmGVAosHWUSUqQYYfPnJCyXOYStCyrRAoS4Qf88e zaHkH1HWLzS+y6CIGd825FxPny9zh1cY7bv0HD4hxmytWXpZyiv7x2KmYzaebSs9CGLi zX+vixuVPj49nUWt5ZKr/pnGqFcPZdqcOfE+C0MIv9r5Ev3OFqXNoF0f+yChSKVUXNRF QaUCIWm6lCXIyYQTTWe0GK52DvF/1RbmovOnKF5/Ee4cWnqU5L1i0GZ/IFvfMXgda+fY 4gsKDO3jz32yPVHAVChqDJ2UP18fWhF2NaJcrAYff5uxfBpCfSAMY4CCYqbGl3YG6A8X Te6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yMlLDOo2; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-178628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178628-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 d2e1a72fcca58-6f4fd546d32si5120078b3a.399.2024.05.14.05.13.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 05:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178628-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=yMlLDOo2; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-178628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178628-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 1047C284BE4 for ; Tue, 14 May 2024 11:53:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE8E9757F3; Tue, 14 May 2024 11:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yMlLDOo2" 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 1DE973D0D1; Tue, 14 May 2024 11:51:14 +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=1715687474; cv=none; b=eWR0JxIOEVIvh9ADVF3krU44Jfg6Fs2chuVsFiOO64OO71W9DwMEPhMXk2F0m7z5V2NWknV/pO6Psz2qpGb06WSgLQ/ycnusHeL7FMTVbsF1m8VtczO2a/AORRF5wwHYrzk7HnjS9450Bd5d17KcgqtRM2pQN82S/917lkwliGM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715687474; c=relaxed/simple; bh=ob9UhLXfsEKUth0Ez4ZrkYRD2T+sIk+OWpjedlJkMZM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s6Cn5JDdnTV+xKzqZX3VGOtlQju6yUlAOOvG5dKHMyUbfff8XdU5RRhwZ3MX0dx+ETW9dHzNkU3YitTnlTTXw0VYM4vGsFdGnOw1EIO7m74ICCnLwW55ocHxC86B4OlS+oLroqLKsipgB/MEle8Zv45nt95tH8/dW5yINvEiJKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yMlLDOo2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F36AC2BD10; Tue, 14 May 2024 11:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715687474; bh=ob9UhLXfsEKUth0Ez4ZrkYRD2T+sIk+OWpjedlJkMZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yMlLDOo2yJ+CRXhSe3U7uIGrQvnLAOrjn6MNrKtOkj/3AymEVhkVGamQuOgwlwV6x Fh4a3Y/oT1YojEDBEJ3q6lzZy8pfnwmAVYACnoAsIE/WONwCXbWq1eLenH4mUGzET3 u0OSXPi0RNGdlVqaDPqNv02HeVwXraOMX1yw//ZM= 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.10 108/111] drm/vmwgfx: Fix invalid reads in fence signaled events Date: Tue, 14 May 2024 12:20:46 +0200 Message-ID: <20240514101001.236155901@linuxfoundation.org> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514100957.114746054@linuxfoundation.org> References: <20240514100957.114746054@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.10-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 @@ -1066,7 +1066,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);