Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp659321pxv; Thu, 15 Jul 2021 12:44:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwddk1S+mL2RnXT/LTZWt47mraQ6y2AdmFptB5ISh/GJ2EssGcGPM3f/oRNOMWq4Ckd9yhz X-Received: by 2002:a05:6402:291a:: with SMTP id ee26mr9367607edb.220.1626378245492; Thu, 15 Jul 2021 12:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626378245; cv=none; d=google.com; s=arc-20160816; b=CSUrFAWkQ8lbjCvH4sDU/1eXo3u7oGgxKfBYGmnRsbg627r8QLCDxJwfNwlYfFe6wH BBIeJ6muzutpK9hAqXZFPEDuEpz78lvc6be2w4A4tehK+UJo5p5ItUTmICscO+e4J/HB kn22vluq4fy7F/VyZKy4iiEdBUPuLIi+fmTjbQE+JacPsldA64OhB680QGy7YPoztL1E CuobmWEApT3SMNKEloJvZOFFUwbhe2vYAtThh9JMkcziI6aRrlBddcc3ksgzRdPloRbF 3+m/WVGdsaqQv0cdIfL32J1CgYzuulPdFtNG3PE379TXbimNQXRpxp/iTWQj2XnPLo7W AsWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8NQWYbny8OJaoNQGDG0xvfsR1UG/eKpUPk4V5pi+Ak4=; b=g4b6JwjkfG/T8nTotoo6OqstMjq9CpN/hfDrtJKVg4CyA64YloOFs+2Jz+ix5+TCUE TiiZeB/XSIphwmYmxay1VlYSqQQiBi62CI6VT4oYUlmNEROH1KVYsfo5ria52rG4GJop yVz9JbWLWD1cwQA/AJLUEvDJN0qc/RkQ/EffxVF5F485tEyUicHfXOCZ8tVaYmim45e6 tc25j3zargIHHEJJajbPhIU56GHnEVD2zmwCCz+oTNpZuE9XOxE9oYjxpyYyRBgezZSr atbqpJ9r8G0e8OmfESqSVbrepq8tzSaXNKiYEAahwm6x7FmBeE0Qg7dJd78ez0wZC6UY 0nVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KEXHIl7u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si8535014edr.36.2021.07.15.12.43.42; Thu, 15 Jul 2021 12:44:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KEXHIl7u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345229AbhGOToo (ORCPT + 99 others); Thu, 15 Jul 2021 15:44:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:51284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244837AbhGOTPR (ORCPT ); Thu, 15 Jul 2021 15:15:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 85FA76141D; Thu, 15 Jul 2021 19:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376302; bh=OSCJ7Nc1IxcH8xx6U5OG5FjvhGPZcW7dI1JL+GUw39Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KEXHIl7u4wL6Rz16qr5k142dpQQi/cLTG9rk4kwgScBnMPaw+8VnPSRcDokveT79r oUz1uX3nRUOVhMltGwn3C28z/8qdBlBIxe4Q4tCb5W6GivF/AIpO40EVNOoHzlwilT iV23uTYM3v7e/Oy5HW93CkxhI93782R2UObV2qX8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= , Rodrigo Vivi Subject: [PATCH 5.13 206/266] drm/i915/display: Do not zero past infoframes.vsc Date: Thu, 15 Jul 2021 20:39:21 +0200 Message-Id: <20210715182646.349674659@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kees Cook commit 07b72960d2b4a087ff2445e286159e69742069cc upstream. intel_dp_vsc_sdp_unpack() was using a memset() size (36, struct dp_sdp) larger than the destination (24, struct drm_dp_vsc_sdp), clobbering fields in struct intel_crtc_state after infoframes.vsc. Use the actual target size for the memset(). Fixes: 1b404b7dbb10 ("drm/i915/dp: Read out DP SDPs") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210617213301.1824728-1-keescook@chromium.org (cherry picked from commit c88e2647c5bb45d04dc4302018ebe6ebbf331823) Signed-off-by: Rodrigo Vivi Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -2850,7 +2850,7 @@ static int intel_dp_vsc_sdp_unpack(struc if (size < sizeof(struct dp_sdp)) return -EINVAL; - memset(vsc, 0, size); + memset(vsc, 0, sizeof(*vsc)); if (sdp->sdp_header.HB0 != 0) return -EINVAL;