Re: funlink() for fun!

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg A. Woods
Date: Monday, July 14, 2003 - 9:08 am

[ On Monday, July 14, 2003 at 16:19:21 (+0200), Matthias Buelow wrote: ]

The behaviour you described is invalid, but that's not the real issue.


I really don't want to sound condescending, but I do get the distinct
feeling that you don't really understand the underlying reason why
funlink() is desirable in the first place.

The underlying goal of having a system call that can unlink a file when
given a file descriptor open on that file is to avoid an unfortunately
common insecure programming technique commonly called a "Time-Of-Check,
Time-Of-Use (TOCTOU) race condition".  Calls to unlink() are vulnerable
if they are passed the fully qualified pathname of a file that was
created in or under an insecure (i.e. world-writable) directory, even if
that path is checked for vulnerabilities and the file's metadata is
compared to that of the originally created file before the unlink() call
is made.  Implementing funlink() in userland would simply move the race
condition to a new place and thus be no fix at all.  However a
system-call implementation of funlink() could ensure the new race
condition is impossible, thus ensuring the functionality fulfils the
underlying requirements.

Indeed it would be dangerous to imply that a userland implementation of
funlink() could do something that, as a userland implementation, it most
certainly could not possibly do.

As we've explored funlink() doesn't make sense as solution for unix-like
systems for very different and far more practical reasons, and it is the
explanation of those reasons that leads to learning what must be done
instead and how the alternatives could be optimized.

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: fsync performance hit on 1.6.1, Daniel Brewer, (Mon Jul 7, 12:45 am)
Re: fsync performance hit on 1.6.1, der Mouse, (Mon Jul 7, 12:53 am)
Re: fsync performance hit on 1.6.1, Chuck Silvers, (Mon Jul 7, 9:33 am)
Re: fsync performance hit on 1.6.1, Chuck Silvers, (Mon Jul 7, 9:39 am)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Mon Jul 7, 11:45 am)
Re: fsync performance hit on 1.6.1, David Laight, (Mon Jul 7, 1:58 pm)
Re: fsync performance hit on 1.6.1, Jochen Kunz, (Tue Jul 8, 1:16 am)
Re: fsync performance hit on 1.6.1, David Laight, (Tue Jul 8, 5:17 am)
Re: fsync performance hit on 1.6.1, Matthias Buelow, (Tue Jul 8, 11:18 am)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Tue Jul 8, 1:57 pm)
Re: fsync performance hit on 1.6.1, Matthias Buelow, (Tue Jul 8, 3:32 pm)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Tue Jul 8, 6:59 pm)
Re: fsync performance hit on 1.6.1, Matthias Buelow, (Tue Jul 8, 7:54 pm)
Re: fsync performance hit on 1.6.1, der Mouse, (Tue Jul 8, 8:09 pm)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Tue Jul 8, 8:44 pm)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Wed Jul 9, 12:01 am)
Re: fsync performance hit on 1.6.1, der Mouse, (Wed Jul 9, 12:11 am)
Re: fsync performance hit on 1.6.1, Christoph Hellwig, (Wed Jul 9, 1:04 am)
Re: fsync performance hit on 1.6.1, Christoph Hellwig, (Wed Jul 9, 1:07 am)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Wed Jul 9, 1:36 am)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Wed Jul 9, 9:26 am)
Re: fsync performance hit on 1.6.1, Christoph Hellwig, (Wed Jul 9, 9:43 am)
Re: fsync performance hit on 1.6.1, Matt Thomas, (Wed Jul 9, 11:13 am)
POSIX shm_open() vs. mmap(MAP_ANON|MAP_SHARED)...., Greg A. Woods, (Wed Jul 9, 11:17 am)
Re: fsync performance hit on 1.6.1, Matthias Buelow, (Wed Jul 9, 11:34 am)
Re: fsync performance hit on 1.6.1, Matthias Buelow, (Wed Jul 9, 11:43 am)
Re: fsync performance hit on 1.6.1, der Mouse, (Wed Jul 9, 12:21 pm)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Wed Jul 9, 12:22 pm)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Wed Jul 9, 12:56 pm)
Re: fsync performance hit on 1.6.1, der Mouse, (Wed Jul 9, 1:05 pm)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Wed Jul 9, 1:40 pm)
Re: fsync performance hit on 1.6.1, der Mouse, (Wed Jul 9, 1:50 pm)
Re: fsync performance hit on 1.6.1, Greywolf, (Wed Jul 9, 2:06 pm)
Re: fsync performance hit on 1.6.1, Christoph Hellwig, (Wed Jul 9, 5:14 pm)
Re: fsync performance hit on 1.6.1, Matthias Buelow, (Wed Jul 9, 6:32 pm)
Re: fsync performance hit on 1.6.1, Kamal R Prasad, (Wed Jul 9, 11:11 pm)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Thu Jul 10, 12:06 am)
Re: fsync performance hit on 1.6.1, Kamal R Prasad, (Thu Jul 10, 12:23 am)
Re: funlink() for fun!, Greg A. Woods, (Thu Jul 10, 9:35 am)
Re: POSIX shm_open() vs. mmap(MAP_ANON|MAP_SHARED)...., Greg A. Woods, (Thu Jul 10, 9:37 am)
Re: fsync performance hit on 1.6.1, Greg A. Woods, (Thu Jul 10, 9:40 am)
Re: funlink() for fun!, Greywolf, (Thu Jul 10, 2:52 pm)
Re: fsync performance hit on 1.6.1, Matthew Mondor, (Thu Jul 10, 3:08 pm)
Re: funlink() for fun!, Greg A. Woods, (Thu Jul 10, 3:34 pm)
Re: funlink() for fun!, Greywolf, (Thu Jul 10, 3:51 pm)
Re: funlink() for fun!, Greg A. Woods, (Thu Jul 10, 4:56 pm)
Re: funlink() for fun!, Greywolf, (Thu Jul 10, 5:31 pm)
Re: funlink() for fun!, der Mouse, (Thu Jul 10, 8:41 pm)
Re: funlink() for fun!, Greg A. Woods, (Thu Jul 10, 11:38 pm)
Re: funlink() for fun!, der Mouse, (Thu Jul 10, 11:43 pm)
Re: funlink() for fun!, Greg A. Woods, (Fri Jul 11, 12:31 am)
Re: funlink() for fun!, der Mouse, (Fri Jul 11, 1:12 am)
Re: funlink() for fun!, David Laight, (Fri Jul 11, 2:36 am)
Re: funlink() for fun!, Roland Dowdeswell, (Fri Jul 11, 8:03 am)
Re: funlink() for fun!, Greg A. Woods, (Fri Jul 11, 10:47 am)
Re: funlink() for fun!, Greg A. Woods, (Fri Jul 11, 10:58 am)
Re: funlink() for fun!, Greywolf, (Fri Jul 11, 1:42 pm)
Re: funlink() for fun!, der Mouse, (Fri Jul 11, 1:48 pm)
Re: funlink() for fun!, Greg A. Woods, (Fri Jul 11, 4:02 pm)
Re: funlink() for fun!, Greywolf, (Fri Jul 11, 4:20 pm)
Re: funlink() for fun!, Matthias Buelow, (Fri Jul 11, 6:38 pm)
Re: funlink() for fun!, Matthias Buelow, (Fri Jul 11, 6:53 pm)
Re: funlink() for fun!, Greywolf, (Fri Jul 11, 7:20 pm)
Re: funlink() for fun!, Greg A. Woods, (Sat Jul 12, 1:11 am)
Re: funlink() for fun!, Greg A. Woods, (Sat Jul 12, 1:47 am)
Re: funlink() for fun!, Greg A. Woods, (Sat Jul 12, 1:54 am)
Re: funlink() for fun!, der Mouse, (Sat Jul 12, 1:57 am)
Re: funlink() for fun!, Greywolf, (Sat Jul 12, 2:11 am)
Re: funlink() for fun!, joerg, (Sat Jul 12, 4:07 am)
Re: funlink() for fun!, Ignatios Souvatzis, (Sat Jul 12, 6:18 am)
Re: funlink() for fun!, Greg A. Woods, (Sat Jul 12, 10:48 am)
Re: funlink() for fun!, Greg A. Woods, (Sat Jul 12, 10:57 am)
Re: funlink() for fun!, Matthias Buelow, (Sun Jul 13, 1:25 pm)
Re: funlink() for fun!, Greg A. Woods, (Sun Jul 13, 3:58 pm)
Re: funlink() for fun!, Matthias Buelow, (Mon Jul 14, 7:19 am)
Re: funlink() for fun!, Greg A. Woods, (Mon Jul 14, 9:08 am)
Re: funlink() for fun!, Greywolf, (Mon Jul 14, 9:24 am)
Re: funlink() for fun!, Matthias Buelow, (Mon Jul 14, 9:34 am)
Re: funlink() for fun!, Greg A. Woods, (Mon Jul 14, 10:44 am)
Re: funlink() for fun!, Ben Harris, (Mon Jul 14, 11:06 am)
Re: funlink() for fun!, Greywolf, (Mon Jul 14, 11:20 am)
Re: funlink() for fun!, Greg A. Woods, (Mon Jul 14, 11:30 am)
Re: funlink() for fun!, Matthias Buelow, (Mon Jul 14, 12:46 pm)
Re: funlink() for fun!, Matthias Buelow, (Mon Jul 14, 1:51 pm)
Re: funlink() for fun!, Greg A. Woods, (Mon Jul 14, 1:58 pm)
Re: funlink() for fun!, Greg A. Woods, (Mon Jul 14, 2:43 pm)
Re: funlink() for fun!, der Mouse, (Mon Jul 14, 3:00 pm)
Re: funlink() for fun!, Greywolf, (Mon Jul 14, 4:05 pm)
Re: funlink() for fun!, der Mouse, (Mon Jul 14, 4:56 pm)
Re: funlink() for fun!, Greg A. Woods, (Mon Jul 14, 5:07 pm)
Re: funlink() for fun!, der Mouse, (Mon Jul 14, 5:42 pm)
re: funlink() for fun!, matthew green, (Mon Jul 14, 8:55 pm)
re: funlink() for fun!, Bill Studenmund, (Tue Jul 15, 10:31 am)
Re: funlink() for fun!, Bill Studenmund, (Tue Jul 15, 10:34 am)
Re: funlink() for fun!, Bill Studenmund, (Tue Jul 15, 11:47 am)
Re: funlink() for fun!, Bill Studenmund, (Tue Jul 15, 12:00 pm)
Re: funlink() for fun!, ww, (Tue Jul 15, 12:09 pm)
Re: funlink() for fun!, Bill Studenmund, (Tue Jul 15, 12:40 pm)
Re: funlink() for fun!, der Mouse, (Tue Jul 15, 12:49 pm)
Re: funlink() for fun!, Ignatios Souvatzis, (Tue Jul 15, 1:02 pm)
Re: funlink() for fun!, Bill Studenmund, (Tue Jul 15, 1:28 pm)
Re: funlink() for fun!, Greg A. Woods, (Wed Jul 16, 12:05 am)