Bug 19382

Summary: xdg-screensaver: Race in suspend/resume can lead to process leak
Product: Portland Reporter: Ben Hutchings <ben>
Component: xdg-utilsAssignee: Fathi Boudra <fabo>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: 1.0   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: proposed fix

Description Ben Hutchings 2009-01-03 15:08:52 UTC
Created attachment 21646 [details] [review]
proposed fix

In xdg-screensaver, do_resume() and track_window() both call
cleanup_suspend() to remove the tracking process from the status file.
cleanup_suspend() removes the process using a grep -v for the window
id.  This means there is a race condition after the first removal
where a new tracking process can be created and then removed from the
status file while it's still active.

I think this can be fixed by either (1) looking for the process id
in the status file or (2) removing one of the
calls to cleanup_suspend().

The attached patch does (1).
Comment 1 Fathi Boudra 2009-07-26 10:15:28 UTC
Fixed in CVS.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.