Skip to content

Commit 07b7296

Browse files
keesrodrigovivi
authored andcommitted
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: 1b404b7 ("drm/i915/dp: Read out DP SDPs") Cc: [email protected] Signed-off-by: Kees Cook <[email protected]> Reviewed-by: José Roberto de Souza <[email protected]> Signed-off-by: José Roberto de Souza <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit c88e264) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 8a02ea4 commit 07b7296

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2868,7 +2868,7 @@ static int intel_dp_vsc_sdp_unpack(struct drm_dp_vsc_sdp *vsc,
28682868
if (size < sizeof(struct dp_sdp))
28692869
return -EINVAL;
28702870

2871-
memset(vsc, 0, size);
2871+
memset(vsc, 0, sizeof(*vsc));
28722872

28732873
if (sdp->sdp_header.HB0 != 0)
28742874
return -EINVAL;

0 commit comments

Comments
 (0)