Re: [PATCH] drm/gud: validate GUD_ROTATION_0 is present in supported rotations

Ruben Wauters <[email protected]>
Newsgroups org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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: [email protected]
> Closes: https://syzkaller.appspot.com/bug?extid=efe2810681f1b065d3a8
> Tested-by: [email protected]
> Signed-off-by: Sajal Gupta <[email protected]>
Acked-by: Ruben Wauters <[email protected]>
> ---
>  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
signature.asc (application/pgp-signature, 870 B)
-----BEGIN PGP SIGNATURE-----

iQJPBAABCAA5FiEE3obNNdPQ9V5CQi2Y0n5QwFCuDOEFAmqLIN8bFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyAAoJENJ+UMBQrgzhdsQP/iFITCkNCJ7BMhf2/Y1f
fdiQgOY3wSVFCVFFA7Td6+F4ICZ92w1jzZc8JTqyHOHoR9tui9DgnKaqyKzO7sve
LlFHXop4l68+W5SxDLyfkki5hb1fyns2Z2496Dn+/+z/HnIVS69WzdgM8uWT3n6K
DYMeqhDQWTpbMYxPRuakjvGmYQuN+wwN7zN3VkK32OyMYx4qO2vO3CyUVtJPq2YN
afLq4rENSHdhFuZCuTY+bsnKxnczt4l21hh3vQf/aiq/EGo6AzSH3Zf03HvA6bro
hwTTuKCorkDXe6jasmln1tNLNAkKjMKHNtQym691kWf7WXcokLyWj3Yz4ypt/tS3
R1g1xuYi8H8pqsq9EcwjKceciJbAHoQRt1NaaRZwg0ZLfGWFFu3uA4FTcKivWkJ1
+hIHnY/uMpSrtE3UIEZ4JM20MI+IHa4ENYTuznkjU/Syjhw4ycuMz5fyXtvd/UGz
6t7s1CXaYuyEV5SecYh/J41tJ7DrkAtgYpsk7WLobTjCdkTyILAUwjS0icYbDaPf
j6a2/0JmM1AsWDwaUwciFT1qR3FBPVlB0kZA6EGF2rViqrWzQ38z2bCjujiup6A8
azebC+ge9KMzJTW8hb7CnvsjP7XuDx89psgt8wuMep8Fxt/3nnjUPsNj0x85YmmV
5ITn0T2ZUAeWcTHi/fhdJm4e
=dH6j
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.