First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 79685
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Thierry Carrez (RETIRED) <koon@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
rmtree.patch rmtree.patch patch Thierry Carrez (RETIRED) 2005-03-08 05:56 0000 7.49 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 79685 depends on: Show dependency tree
Bug 79685 blocks:

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-01-27 02:10 0000
Paul Szabo brought to our attention that the fix for CAN-2004-0452 does not
handle all race conditions case and that rmtree is still vulnerable :

=============================================
Just changing the chmod to 0700 and 0600 instead of 0777 and 0666
does NOT solve the issue. The chmod change was for another, but related,
problem. See bugs.debian.org/286905 and 286922.
=============================================

------- Comment #1 From Thierry Carrez (RETIRED) 2005-01-27 02:11:38 0000 -------
Looking for a definitive patch for this issue.

------- Comment #2 From Thierry Carrez (RETIRED) 2005-02-07 09:16:36 0000 -------
Comments about rmtree committed into Owl release :

==========================
There're race conditions internal to the implementation of <rmtree> making it unsafe to use on directory trees which may be altered or moved while <rmtree> is running, and in particular on any directory trees with any path components or subdirectories potentially writable by untrusted users.

Additionally, if the third parameter is not TRUE and <rmtree> is interrupted, it may leave files and directories with permissions altered to allow deletion (and older versions of this module would even set files and directories to world-read/writable!)

Note also that the occurrence of errors in <rmtree> can be determined only by trapping diagnostic messages using $SIG{__WARN__}; it is not apparent from the return value.
=========================

Maybe we should "fix" this by documenting it like this.

------- Comment #3 From Thierry Carrez (RETIRED) 2005-03-02 06:51:21 0000 -------
I think we should close this one. rmtree has race conditions by design...
Comments ?

------- Comment #4 From Thierry Carrez (RETIRED) 2005-03-08 05:56:25 0000 -------
Created an attachment (id=52935) [details]
rmtree.patch

Patch from Debian (applies cleanly if you don't apply the previous
file_path_rmtree.patch)

Warning! This patch seems to ignore macos specific code:

"I've also ignored $Is_VMS and $Is_MacOS; will need some input from
perl5-porters as to what changes are required to support those
platforms."

CAN-2005-0448

------- Comment #5 From Thierry Carrez (RETIRED) 2005-03-08 05:57:43 0000 -------
Perl team, please apply patch or comment...

------- Comment #6 From Michael Cummings (RETIRED) 2005-03-08 07:04:15 0000 -------
Are we worried about macos support (which is lacking in this patch) (and i see
them lurking over my shoulder)?

I still want to say that this patch doesn't defeat the race condition, but
comes pretty close (relies on the inode/stat of the dir comparing before and
after a chdir). Would this still work on an nfs mount where the nfs sync wasn't
running up to par, ie, changes made on another server with the nfs mount don't
get replicated across until after the chdir occurs? just saying...

for general purpose uses, yes, this patch should cover most cases, and I may be
overthinking/misunderstanding it :)

------- Comment #7 From Thierry Carrez (RETIRED) 2005-03-08 07:19:21 0000 -------
I think we can commit this and forget to add macos keywords, and let them patch
the patch if needed when they add their own keywords ? Or we can pull them in
so that they do it now.

Adding ppc-macos herd to the mix.

------- Comment #8 From Lina Pezzella (RETIRED) 2005-03-08 10:32:40 0000 -------
Go ahead and push it through. ppc-macos will not be keywording anything perl in
the near future.

------- Comment #9 From Michael Cummings (RETIRED) 2005-03-09 11:16:12 0000 -------
Confirmed that it applies and runs smoothly on all three versions in the tree.
Are we good for a version bump & release or do you need time?

------- Comment #10 From Sune Kloppenborg Jeppesen 2005-03-10 11:03:09 0000 -------
Micheal please go ahead.

------- Comment #11 From Michael Cummings (RETIRED) 2005-03-11 07:13:55 0000 -------
Posted and bumped across the board.

------- Comment #12 From Sune Kloppenborg Jeppesen 2005-03-11 07:19:00 0000 -------
Thx Micheal. This one is ready for GLSA vote.

------- Comment #13 From Michael Cummings (RETIRED) 2005-03-11 11:14:26 0000 -------
STOP. I messed up somewhere and need to roll back and get this fixed. I read
the patch, read it as clean, but as soon as it hit the tree I started getting
bug reports against it. I accept responsibility for this,

Mike

------- Comment #14 From Michael Cummings (RETIRED) 2005-03-11 12:19:46 0000 -------
I'm rolling back until we can get a better solution. This patch will break this
module on any box that changes kernel versions. I don't deny that a fix is
needed, but the problem is that in using Errno, it uses
/usr/lib*/perl5/<current-version>/<archversion>/Errno.pm (path varies depending
on arch), which records your kernel version/platform at install. This patch
invokes it and throws an error for anyone that has changed kernels.

------- Comment #15 From Luke Macken (RETIRED) 2005-03-11 12:48:55 0000 -------
back to [ebuild] status.

------- Comment #16 From Michael Cummings (RETIRED) 2005-03-11 13:45:03 0000 -------
I don't know if I've ever had such a frantic session...fixed. For good.
Patching from a better location in the process.

------- Comment #17 From Luke Macken (RETIRED) 2005-03-11 21:38:25 0000 -------
Nice save Michael :)

Security, please vote on GLSA.

------- Comment #18 From Thierry Carrez (RETIRED) 2005-03-14 01:21:20 0000 -------
I vote yes, as an update to GLSA 200501-38

------- Comment #19 From Sune Kloppenborg Jeppesen 2005-03-15 02:01:35 0000 -------
I vote YES to the GLSA update as well.

------- Comment #20 From Thierry Carrez (RETIRED) 2005-03-15 04:44:12 0000 -------
I'll do it

------- Comment #21 From Thierry Carrez (RETIRED) 2005-03-15 07:39:33 0000 -------
Released as GLSA 200501-38:03 update

First Last Prev Next    No search results available      Search page      Enter new bug