On Mon, 2009-03-23 at 10:47 -0400, Paul Dufresne wrote: > My reasoning is that the http://samba.org/~tridge/junkcode/aio_uid.c > does seems to be all inside a simple process and not be using pthreads. > AIO is Asynchronous I/O.
Therefore an asynchronous operation can complete while *inside* the setresuid() call. It matters not whether the individual process is multi-threaded or not, the kernel is effectively acting as a separate thread. This is explained in the comment at the top of the file you gave the URL to: The race condition is in setresuid(), which in glibc tries to be smart about threads and change the euid of threads when the euid of the main program changes. The problem is that this makes setresuid() non-atomic, which means that if an IO completes during the complex series of system calls that setresuid() becomes, then the thread completing the IO may get -1/EPERM back from the rt_sigqueueinfo() call that it uses to notify its parent of the completing IO. In that case two things happen: Scott -- Scott James Remnant sc...@canonical.com
signature.asc
Description: This is a digitally signed message part
-- Ubuntu-devel-discuss mailing list Ubuntu-devel-discuss@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss