[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210617213301.1824728-1-keescook@chromium.org>
Date: Thu, 17 Jun 2021 14:33:01 -0700
From: Kees Cook <keescook@...omium.org>
To: Jani Nikula <jani.nikula@...el.com>
Cc: Kees Cook <keescook@...omium.org>, stable@...r.kernel.org,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Ville Syrjälä
<ville.syrjala@...ux.intel.com>, Imre Deak <imre.deak@...el.com>,
Ankit Nautiyal <ankit.k.nautiyal@...el.com>,
Manasi Navare <manasi.d.navare@...el.com>,
Uma Shankar <uma.shankar@...el.com>,
José Roberto de Souza <jose.souza@...el.com>,
Lucas De Marchi <lucas.demarchi@...el.com>,
Sean Paul <seanpaul@...omium.org>,
Gwan-gyeong Mun <gwan-gyeong.mun@...el.com>,
linux-kernel@...r.kernel.org, intel-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-hardening@...r.kernel.org
Subject: [PATCH] drm/i915/display: Do not zero past infoframes.vsc
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@...r.kernel.org
Signed-off-by: Kees Cook <keescook@...omium.org>
---
drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 5c9222283044..6cc03b9e4321 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2868,7 +2868,7 @@ static int intel_dp_vsc_sdp_unpack(struct drm_dp_vsc_sdp *vsc,
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;
--
2.25.1
Powered by blists - more mailing lists