]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/hyperv: validate resolution_count and fix WIN8 fallback
authorBerkant Koc <me@berkoc.com>
Tue, 19 May 2026 20:08:17 +0000 (22:08 +0200)
committerHamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Mon, 25 May 2026 11:31:36 +0000 (07:31 -0400)
commit13d33b9ef67066c77c84273fac5a1d3fde3533d1
tree9997fb0afdbd5963654e0750e03944efe123b35d
parenta8878e19d2f5205ad1f170fc230c2cc25a3b9390
drm/hyperv: validate resolution_count and fix WIN8 fallback

A SYNTHVID_RESOLUTION_RESPONSE with resolution_count > 64 walks past
the supported_resolution[SYNTHVID_MAX_RESOLUTION_COUNT] array in the
parse loop. Bound resolution_count against the array size, folded
into the existing zero-check.

When the WIN10 resolution probe fails, the caller in
hyperv_connect_vsp() left hv->screen_*_max / preferred_* unpopulated,
which sets mode_config.max_width / max_height to 0 and makes
drm_internal_framebuffer_create() reject every userspace framebuffer
with -EINVAL. The pre-WIN10 branch had the same gap for
preferred_width / preferred_height. Use a single post-probe fallback
guarded by screen_width_max == 0 so both paths converge on the WIN8
defaults.

Signed-off-by: Berkant Koc <me@berkoc.com>
Assisted-by: Claude:claude-opus-4-7 berkoc-pipeline
Fixes: 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device")
Cc: stable@vger.kernel.org # 5.14+
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Link: https://patch.msgid.link/6945b22419c7d404b4954a113de2ac9c900dba93.1779542874.git.me@berkoc.com
drivers/gpu/drm/hyperv/hyperv_drm_proto.c