bugfindutils - Bugs: bug #27375, find leaks fds to child processes

 
 

bug #27375: find leaks fds to child processes

Submitted by:  Eric Blake <ericb>
Submitted on:  Wed 02 Sep 2009 09:37:26 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: Wrong resultStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Eric BlakeOpen/Closed: Closed
Release: NoneFixed Release: 4.5.6b

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 29 Mar 2010 11:53:49 PM UTC, comment #3:

Fixed in 4.5.x (i.e. the "master" branch in git)

(I changed the patch a little to fix some "make dist" bugs and have the check controlled by an environment variable)

James Youngman <jay>
Project AdministratorIn charge of this item.
Mon 29 Mar 2010 10:30:30 AM UTC, comment #2:

The attached patch should fix the problem and include a self-test (though it's not a regression test).

(file #20064)

James Youngman <jay>
Project AdministratorIn charge of this item.
Wed 02 Sep 2009 09:52:00 PM UTC, comment #1:

This patch fixes part of the leak; the other part comes from updating gnulib to pick up my patch to plug fts. Still needs NEWS and a testsuite addition (ls /proc/self/fd is cute, but it would be nice if there were something more portable. Using -exec sh -c 'exec 4<&3' \; and checking for an error message from sh relating to failure to clone fd 3 from sh may be a bit better, but that is still not portable to all shells).

(file #18671)

Eric Blake <ericb>
Project Administrator
Wed 02 Sep 2009 09:37:26 PM UTC, original submission:

Find currently leaks directory fds to child processes. This could be considered a minor security hole, since a rogue child could fchdir into a directory that would otherwise be inaccessible, or even play games such as using rewinddir(fdopendir(n)) on a leaked fd to change the state visible if the parent later calls readdir on the same underlying fd. Also, the leak puts the child that much closer to hitting EMFILE limits.

Eric Blake <ericb>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #18671:  findutils.patch1 added by ericb (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Updated the item)
  • -unavailable- added by ericb (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 31 Mar 2010 07:28:53 AM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.5.6b
    Mon 29 Mar 2010 11:53:49 PM UTCjayStatusConfirmed=>Fixed
      Assigned toericb=>jay
    Mon 29 Mar 2010 10:30:30 AM UTCjayAttached File-=>Added 0001-Fix-file-descriptor-leaks.patch, #20064
    Wed 02 Sep 2009 09:52:00 PM UTCericbAttached File-=>Added findutils.patch1, #18671

    Back to the top


    Powered by Savane 3.1-cleanup1