Re: [PATCH] drm: Optimized by adding the TV modes attribute
Ruben Wauters <[email protected]>
| Newsgroups | org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 2026-08-17 at 20:37 +0800, Edward Adam Davis wrote:
> When adding gud properties for drm connector within the function
> gud_connector_add_properties(), if the TV modes property is not added
> first, drm_mode_create_tv_properties_legacy() would fail to add the TV
> modes property because the tv_select_subconnector_property has already
> been added.
>
> This causes gud_connector_property_lookup() to fail when looking for
> the TV modes property (returning NULL), which subsequently triggers
> issue [1] when a NULL property is passed to drm_object_attach_property().
>
> The fix ensures that within drm_mode_create_tv_properties_legacy(), the
> TV modes property is correctly added regardless of whether the subconnector
> property exists.
>
> [1]
> Oops: general protection fault, probably for non-canonical address 0xdffffc000000000c: 0000 [#1] SMP KASAN NOPTI
> KASAN: null-ptr-deref in range [0x0000000000000060-0x0000000000000067]
> RIP: 0010:drm_object_attach_property+0x85/0x3b0 drivers/gpu/drm/drm_mode_object.c:240
> Call Trace:
> gud_connector_add_properties drivers/gpu/drm/gud/gud_connector.c:572 [inline]
> gud_connector_create drivers/gpu/drm/gud/gud_connector.c:680 [inline]
> gud_get_connectors+0x86e/0x1700 drivers/gpu/drm/gud/gud_connector.c:717
> gud_probe+0x17aa/0x1c20 drivers/gpu/drm/gud/gud_drv.c:635
>
> Fixes: f453ba046074 ("DRM: add mode setting support")
> Reported-by: [email protected]
> Closes: https://syzkaller.appspot.com/bug?extid=1944765c3659f63d3777
> Tested-by: [email protected]
> Signed-off-by: Edward Adam Davis <[email protected]>
Acked-by: Ruben Wauters <[email protected]>
> ---
> drivers/gpu/drm/drm_connector.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 11646453aaac..ecbbc967f51f 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -2175,8 +2175,12 @@ int drm_mode_create_tv_properties_legacy(struct drm_device *dev,
> struct drm_property *tv_subconnector;
> unsigned int i;
>
> - if (dev->mode_config.tv_select_subconnector_property)
> + if (dev->mode_config.tv_select_subconnector_property) {
> + if (num_modes && !dev->mode_config.legacy_tv_mode_property)
> + goto other;
> +
> return 0;
> + }
>
> /*
> * Basic connector properties
> @@ -2199,6 +2203,7 @@ int drm_mode_create_tv_properties_legacy(struct drm_device *dev,
> goto nomem;
> dev->mode_config.tv_subconnector_property = tv_subconnector;
>
> +other:
> /*
> * Other, TV specific properties: margins & TV modes.
> */
signature.asc
(application/pgp-signature, 870 B)
-----BEGIN PGP SIGNATURE----- iQJPBAABCAA5FiEE3obNNdPQ9V5CQi2Y0n5QwFCuDOEFAmqDKysbFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyAAoJENJ+UMBQrgzh/qkP/33EARU9YdD+Uqv67N/R FeA+5Yq6MrkWRVWu7EXo3RPrliHkuqkJ9pZeolmCWGYedPVlda5k1iwXVLuT7omE 8dNC+Pb+0rROEt/i+Pvk/YN2rW9uU307RaEsuSaX9+A2WAR9NaCq3N6zGgX4gENR eiT5MIqD9AKVGcDRQH+aquPjPLUxTSxfHAtlYuVUBeQP5ZxEvQ1SaX2sd4aPe3bx uChCU8/22E2t36DeH4JKphYDyvKHG/+HHj4wOCYkgfYetZ6Yi1MIoKZmo8QStuYK W4xQyrxhSHwAXorKbQdsdIaN1IXxaa8CDibpzyKCsaV4/lzceZDZMvuuyk5Zmcgs FE1vgDgQCQnn1OqdTs5vEbmvhBkY/zxNsUHCXnuqZ76Dg5FEihlaUBBZUjiH23FZ 5m51r6ETM2fYwrlGOzs35wVzPwasE7jGIoxg0HmO/L8U5yXcjtp68Y1b4XE3AfYc yl2tUIhAKDf++/VTMFVGHJkoGMR64NdL2IIkNyU1oagknmLJMxo0MByb6i/4B2AJ M44VS+Lb/HbZSsTl8IBmotazqnsl4UKbY7iKkjGHsaQqNXVaXizsFLAiGEFmk0vX aOZldItxZ0CbGmXOYMkS+5uNB0E9KrrRgD4k8UtCgg6b4TM5YJm+aKvYUBPdxN0k d9M+pGEPS8gCEBTMsWxOw0In =7f31 -----END PGP SIGNATURE-----