Re: Does sendfile() copy extended attributes?

Jamie Lokier
2003-12-20T20:40:46Z

Joseph D. Wagner wrote:
> Because that violates one of the Immutable Laws of Security -- "If
> you're running someone else's program, it's not your program anymore."

That is equally the case if you're running someone else's function.

> If my program executes another program like cp/rsync in your
> example, it would be vulnerable to a privilege elevation when run as
> root. A hacker could replace cp/rsync, change the PATH, or a dozen
> other tricks to get it to execute his version of cp/rsync.

A hacker could also change libc.so and thereby change the copy function.

> Now if there's a function call that will copy a file -- other than
> the sendfile function which is what this thread has been all about --
> I'm all ears. However, I am not going to execute another program.

You are imagining a black box function which is specified to copy a
file and its attributes. How can you know that function does not work
by calling an external program?

-- Jamie