Re: sys_write() racy for multi-threaded append?

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Michael K. Edwards <medwards.linux@...>, Eric Dumazet <dada1@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Monday, March 12, 2007 - 3:53 am

Michael K. Edwards <medwards.linux@gmail.com> wrote:


This is a security risk.

----------------
other process:
unlink(secrest_file)

Thread 1:
write(fd, large)
(interrupted)

Thread 2:
fseek(fd, -n, relative)
read(fd, buf)
----------------

BTW: The best thing you can do to a program where two threads race for
writing one fd is to let it crash and burn in the most spectacular way
allowed without affecting the rest of the system, unless it happens to
be a pipe and the number of bytes written is less than PIPE_MAX.
-- 
The secret of the universe is #@*%! NO CARRIER 

Friß, Spammer: dyIw3Rs@x.7eggert.dyndns.org PLxmr@lv.7eggert.dyndns.org
 HmiJuSaiuF@b.7eggert.dyndns.org rKjmsxE@7eggert.dyndns.org
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: sys_write() racy for multi-threaded append?, Bodo Eggert, (Mon Mar 12, 3:53 am)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Mon Mar 12, 12:26 pm)
Re: sys_write() racy for multi-threaded append?, Bodo Eggert, (Mon Mar 12, 2:48 pm)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Mon Mar 12, 8:46 pm)
Re: sys_write() racy for multi-threaded append?, Alan Cox, (Mon Mar 12, 10:24 pm)
Re: sys_write() racy for multi-threaded append?, David M. Lloyd, (Tue Mar 13, 10:00 am)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Tue Mar 13, 3:25 am)
Re: sys_write() racy for multi-threaded append?, Alan Cox, (Tue Mar 13, 9:15 am)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Wed Mar 14, 4:09 pm)
Re: sys_write() racy for multi-threaded append?, Frank Ch. Eigler, (Fri Mar 16, 12:43 pm)
Re: sys_write() racy for multi-threaded append?, Alan Cox, (Fri Mar 16, 1:25 pm)
Re: sys_write() racy for multi-threaded append?, David Miller, (Tue Mar 13, 3:42 am)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Tue Mar 13, 12:24 pm)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Tue Mar 13, 1:59 pm)
Re: sys_write() racy for multi-threaded append?, Christoph Hellwig, (Tue Mar 13, 3:09 pm)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Tue Mar 13, 7:40 pm)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Tue Mar 13, 8:09 pm)