drivers/gpu/drm/gud/gud_drv.c | 2 ++ 1 file changed, 2 insertions(+)
The rotation argument to drm_plane_create_rotation_property() is set to
DRM_MODE_ROTATE_0, and the device reported rotation bitmask is used as
the supported_rotations argument. The driver never validates that
GUD_ROTATION_0 is present, so a device that omits it from its
GUD_PROPERTY_ROTATION triggers the
WARN_ON(rotation & ~supported_rotations) in
drm_plane_create_rotation_property()
Fix this by skipping the creation of rotation property if the device
doesn't have the GUD_ROTATION_0 bit
Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Reported-by: syzbot+efe2810681f1b065d3a8@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=efe2810681f1b065d3a8
Tested-by: syzbot+efe2810681f1b065d3a8@syzkaller.appspotmail.com
Signed-off-by: Sajal Gupta <sajal2005gupta@gmail.com>
---
drivers/gpu/drm/gud/gud_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c
index 89bd6ca36003..3a1b9e2a2eaa 100644
--- a/drivers/gpu/drm/gud/gud_drv.c
+++ b/drivers/gpu/drm/gud/gud_drv.c
@@ -289,6 +289,8 @@ static int gud_plane_add_properties(struct gud_device *gdrm)
* but mask out any additions on future devices.
*/
val &= GUD_ROTATION_MASK;
+ if (!(val & GUD_ROTATION_0))
+ continue;
ret = drm_plane_create_rotation_property(&gdrm->plane,
DRM_MODE_ROTATE_0, val);
break;
--
2.55.0
On Fri, 2026-08-21 at 12:46 +0530, Sajal Gupta wrote:
> The rotation argument to drm_plane_create_rotation_property() is set to
> DRM_MODE_ROTATE_0, and the device reported rotation bitmask is used as
> the supported_rotations argument. The driver never validates that
> GUD_ROTATION_0 is present, so a device that omits it from its
> GUD_PROPERTY_ROTATION triggers the
> WARN_ON(rotation & ~supported_rotations) in
> drm_plane_create_rotation_property()
>
> Fix this by skipping the creation of rotation property if the device
> doesn't have the GUD_ROTATION_0 bit
Hello, Thank you for the patch
>
> Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
> Reported-by: syzbot+efe2810681f1b065d3a8@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=efe2810681f1b065d3a8
> Tested-by: syzbot+efe2810681f1b065d3a8@syzkaller.appspotmail.com
> Signed-off-by: Sajal Gupta <sajal2005gupta@gmail.com>
Acked-by: Ruben Wauters <rubenru09@aol.com>
> ---
> drivers/gpu/drm/gud/gud_drv.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c
> index 89bd6ca36003..3a1b9e2a2eaa 100644
> --- a/drivers/gpu/drm/gud/gud_drv.c
> +++ b/drivers/gpu/drm/gud/gud_drv.c
> @@ -289,6 +289,8 @@ static int gud_plane_add_properties(struct gud_device *gdrm)
> * but mask out any additions on future devices.
> */
> val &= GUD_ROTATION_MASK;
> + if (!(val & GUD_ROTATION_0))
> + continue;
> ret = drm_plane_create_rotation_property(&gdrm->plane,
> DRM_MODE_ROTATE_0, val);
> break;
> --
> 2.55.0
© 2016 - 2026 Red Hat, Inc.