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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170105084324.n33j6jrprnhbg736@phenom.ffwll.local>
Date:   Thu, 5 Jan 2017 09:43:24 +0100
From:   Daniel Vetter <daniel@...ll.ch>
To:     Peter Ujfalusi <peter.ujfalusi@...com>
Cc:     daniel.vetter@...el.com, jani.nikula@...ux.intel.com,
        seanpaul@...omium.org, airlied@...ux.ie, gleb@...tmail.com,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        freedesktop-bugs@...lSD.com
Subject: Re: [PATCH] drm: Schedule the output_poll_work with 1s delay if we
 have delayed event

On Wed, Jan 04, 2017 at 02:00:53PM +0200, Peter Ujfalusi wrote:
> Instead of scheduling the work to handle the initial delayed event, use 1s
> delay.
> 
> When the delayed event is handled w/o delay - in a similar matter when the
> poll had been initialized before drm_helper_probe_single_connector_modes()
> is called - it triggers a race in Optimus setups.
> 
> Fixes: 339fd36238dd ("drm: drm_probe_helper: Fix output_poll_work scheduling")
> Cc: stable@...r.kernel.org   # v4.9
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
> ---
> Hi,
> 
> related bug report: https://bugs.freedesktop.org/show_bug.cgi?id=98690
> 
> Regards,
> Peter
> 
>  drivers/gpu/drm/drm_probe_helper.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index 98ed110e28ed..f30c14b0a72f 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -146,8 +146,9 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
>  	drm_connector_list_iter_put(&conn_iter);
>  
>  	if (dev->mode_config.delayed_event) {
> +		/* Use short (1s) delay to handle the initial delayed event */
>  		poll = true;
> -		delay = 0;
> +		delay = HZ;

This smells a bit like duct-tape papering over some other race. Lack of
locking or something else. Most likely some drivers enable polling a bit
too early in their load sequence. And if we can't figure this out, then we
need some really big FIXME: here that this papers over driver races.
-Daniel

>  	}
>  
>  	if (poll)
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ