lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 08 Oct 2014 10:33:54 +0900
From:	Inki Dae <inki.dae@...sung.com>
To:	Andrzej Hajda <a.hajda@...sung.com>
Cc:	Joonyoung Shim <jy0922.shim@...sung.com>,
	Seung-Woo Kim <sw0312.kim@...sung.com>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	David Airlie <airlied@...ux.ie>,
	Kukjin Kim <kgene.kim@...sung.com>,
	"open list:DRM DRIVERS FOR E..." <dri-devel@...ts.freedesktop.org>,
	"moderated list:ARM/S5P EXYNOS AR..." 
	<linux-samsung-soc@...r.kernel.org>,
	open list <linux-kernel@...r.kernel.org>, drake@...lessm.com,
	daniel@...ll.ch, m.szyprowski@...sung.com
Subject: Re: [PATCH] drm/exynos: init vblank with real number of crtcs

On 2014년 10월 08일 00:28, Inki Dae wrote:
> 
> Sorry for late.
> 
> On 2014년 10월 07일 21:27, Andrzej Hajda wrote:
>> Hi Inki,
>>
>> Gently ping.
>>
>> Andrzej
>>
>>
>> On 09/19/2014 02:57 PM, Andrzej Hajda wrote:
>>> Initialization of vblank with MAX_CRTC caused attempts
>>> to disabling vblanks for non-existing crtcs in case
>>> drm used fewer crtcs. The patch fixes it.
> 
> Nice catch~ This patch also resolves unbind issue. When exynos driver is
> unbound, disable_vblank callback is called as dev->num_crtcs so if the
> number of probed crtc drivers is different from the one of enabled crtc

Oops, s/the one of enabled crtc drivers/MAX_CRTC

> drivers then it could attempt to disabling vblank for non-existing crtc,
> which in turn, null pointer access occurs.
> 
> Thanks,
> Inki Dae
> 
>>>
>>> Signed-off-by: Andrzej Hajda <a.hajda@...sung.com>
>>> ---
>>>  drivers/gpu/drm/exynos/exynos_drm_drv.c | 18 +++++++++---------
>>>  1 file changed, 9 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
>>> index 9b00e4e..dc4affd 100644
>>> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
>>> @@ -94,10 +94,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
>>>  	/* init kms poll for handling hpd */
>>>  	drm_kms_helper_poll_init(dev);
>>>  
>>> -	ret = drm_vblank_init(dev, MAX_CRTC);
>>> -	if (ret)
>>> -		goto err_mode_config_cleanup;
>>> -
>>>  	/* setup possible_clones. */
>>>  	exynos_drm_encoder_setup(dev);
>>>  
>>> @@ -106,22 +102,26 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
>>>  	/* Try to bind all sub drivers. */
>>>  	ret = component_bind_all(dev->dev, dev);
>>>  	if (ret)
>>> -		goto err_cleanup_vblank;
>>> +		goto err_mode_config_cleanup;
>>> +
>>> +	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
>>> +	if (ret)
>>> +		goto err_unbind_all;
>>>  
>>>  	/* Probe non kms sub drivers and virtual display driver. */
>>>  	ret = exynos_drm_device_subdrv_probe(dev);
>>>  	if (ret)
>>> -		goto err_unbind_all;
>>> +		goto err_cleanup_vblank;
>>>  
>>>  	/* force connectors detection */
>>>  	drm_helper_hpd_irq_event(dev);
>>>  
>>>  	return 0;
>>>  
>>> -err_unbind_all:
>>> -	component_unbind_all(dev->dev, dev);
>>>  err_cleanup_vblank:
>>>  	drm_vblank_cleanup(dev);
>>> +err_unbind_all:
>>> +	component_unbind_all(dev->dev, dev);
>>>  err_mode_config_cleanup:
>>>  	drm_mode_config_cleanup(dev);
>>>  	drm_release_iommu_mapping(dev);
>>> @@ -138,8 +138,8 @@ static int exynos_drm_unload(struct drm_device *dev)
>>>  	exynos_drm_fbdev_fini(dev);
>>>  	drm_kms_helper_poll_fini(dev);
>>>  
>>> -	component_unbind_all(dev->dev, dev);
>>>  	drm_vblank_cleanup(dev);
>>> +	component_unbind_all(dev->dev, dev);
>>>  	drm_mode_config_cleanup(dev);
>>>  	drm_release_iommu_mapping(dev);
>>>  
>>>
>>
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists