Re: Security question: "Text file busy" overwriting executables but not shared libraries?

From: Eric W. Biederman (
Date: Sun Oct 14 2001 - 01:49:34 EST

Linus Torvalds <> writes:

> On Sat, 13 Oct 2001, Jamie Lokier wrote:
> >
> > There are applications (GCC comes to mind) which are using mmap() to
> > read files now because it is measurably faster than read(), for
> > sufficiently large source files.
> >
> > I don't know where the optimal costs lie.
> The gcc people tested it, and their cut-off point is at 30kB or so.
> Anything smaller than that is faster to just "read()".
> Now, that's a traditional mmap(), though, which has more overhead than a
> "read-with-PAGE_COPY" would have. The pure mmap() approach has the actual
> page fault overhead too, along with having to do "fstat()" and "munmap()".

Hmm. read-with-PAGE_COPY may not be any faster than read as you still
read all of the data into memory, so you have almost the same latency.
mmap might work better because of better overlapping of I/O and cpu

Also read-with-PAGE_COPY has some really interesting implications for the
page out routines. Because anytime you start the page out you have to
copy the page. Not exactly when you want to increase the memory presure.
And not at all suitable for shared libraries.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Oct 15 2001 - 21:00:53 EST