Bugtraq mailing list archives
Re: /proc filesystem allows bypassing directory permissions on Linux
From: Dan Yefimov <dan () lightwave net ru>
Date: Thu, 29 Oct 2009 18:24:01 +0300
On 29.10.2009 0:27, Pavel Machek wrote:
Do you still remember about openat()? If the directory was created with 0700 mode from the origin, you would be right, and procfs wouldn't allow opening files in that directory too, but if you let others to traverse that directory and open your believed to be secure files from the origin, it's your fault.That race is easily fixed.No, you're not right.After chmodding the directory to 0700, *first* check the link count, *then* chmod the file to 0666: User1 creates file with permissions 0644 User2 opens file for read access on file descriptor 4 User1 chmod's directory to 0700 User1 verifies no hard links to fileHere's a window, during which User2 is able to create a hardlink and that will remain unnoticed by User1. There's no way to perform link check and conditionally do chmod in an atomic manner.0700 on directory prevents hardlink creation, see?
-- Sincerely Your, Dan.
Current thread:
- Re: /proc filesystem allows bypassing directory permissions on Linux, (continued)
- Re: /proc filesystem allows bypassing directory permissions on Linux Pavel Machek (Oct 23)
- Re: /proc filesystem allows bypassing directory permissions on Linux Dan Yefimov (Oct 26)
- Re: /proc filesystem allows bypassing directory permissions on Linux Pavel Machek (Oct 26)
- Re: /proc filesystem allows bypassing directory permissions on Linux Dan Yefimov (Oct 26)
- Re: /proc filesystem allows bypassing directory permissions on Linux Stephen Harris (Oct 26)
- Re: /proc filesystem allows bypassing directory permissions on Linux Vincent Zweije (Oct 27)
- Re: /proc filesystem allows bypassing directory permissions on Linux Dan Yefimov (Oct 28)
- Re: /proc filesystem allows bypassing directory permissions on Linux psz (Oct 29)
- Re: /proc filesystem allows bypassing directory permissions on Linux Vincent Zweije (Oct 29)
- Re: /proc filesystem allows bypassing directory permissions on Linux Pavel Machek (Oct 29)
- Re: /proc filesystem allows bypassing directory permissions on Linux Dan Yefimov (Oct 29)
- Re: /proc filesystem allows bypassing directory permissions on Linux Pavel Machek (Oct 29)
- Re: /proc filesystem allows bypassing directory permissions on Linux Jim Paris (Oct 30)
- Re: /proc filesystem allows bypassing directory permissions on Linux Marco Verschuur (Oct 30)
- Re: /proc filesystem allows bypassing directory permissions on Linux Pavel Machek (Oct 30)
- Re: /proc filesystem allows bypassing directory permissions on Linux Marco Verschuur (Oct 30)
- Message not available
- Re: /proc filesystem allows bypassing directory permissions on Linux Pavel Machek (Oct 30)
- Re: /proc filesystem allows bypassing directory permissions on Linux psz (Oct 30)
- Re: /proc filesystem allows bypassing directory permissions on Linux Pavel Machek (Oct 23)
- Re: /proc filesystem allows bypassing directory permissions on Linux Jim Paris (Oct 30)
- Re: /proc filesystem allows bypassing directory permissions on Linux Marco Verschuur (Oct 30)
- Re: /proc filesystem allows bypassing directory permissions on Linux Joel Maslak (Oct 26)