Fix a bound check in the DMC fw load.

-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEbSBwaO7dZQkcLOKj+mJfZA7rE8oFAmG5xmgACgkQ+mJfZA7r
 E8pxHgf+Pk1JAVupvoIJxJ+p+HqCCJwZg5kM0vev6X/3ShMtYN2dWpK3rNIPUl8r
 6nsQuwfPV02o2EpdNIeQoSzxjJwpMd00kOELW6L9kQDP3lNjTM33YXWjz3RYE6Sw
 lfFeH3Jysp6VMJBY5B0FN9gTXAbHOHN8eWLtAxb1qJX0FqZ6lPxa+jc7uJxF5wsB
 adXHUVQce/I/hTAwWBcSe/MhVf+nzphT4iWrj8xXV3RKeEsCn3jwTh7RIeJcJtTL
 IW594uKvjdGaeFBK5jYTa7yOS91OqjGJFb/6Q4SCrb8aJPh04TOJ35qrrkeJyNXk
 panxp1isr3pAaf/U+JePdiZpLyymYg==
 =fv3X
 -----END PGP SIGNATURE-----

Merge tag 'drm-intel-fixes-2021-12-15' of ssh://git.freedesktop.org/git/drm/drm-intel into drm-fixes

Fix a bound check in the DMC fw load.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/YbnGvnsX/H3rKAqO@intel.com
This commit is contained in:
Dave Airlie 2021-12-16 10:22:23 +10:00
commit c9f0322c46
1 changed files with 1 additions and 1 deletions

View File

@ -596,7 +596,7 @@ static void parse_dmc_fw(struct drm_i915_private *dev_priv,
continue;
offset = readcount + dmc->dmc_info[id].dmc_offset * 4;
if (fw->size - offset < 0) {
if (offset > fw->size) {
drm_err(&dev_priv->drm, "Reading beyond the fw_size\n");
continue;
}