Re: Does sendfile() copy extended attributes?

Jamie Lokier
2003-12-21T19:54:32Z

Shaya Potter wrote:
> On Sun, 2003-12-21 at 14:31, Joseph D. Wagner wrote:
> > > I think you read what I wrote the wrong way. Let me rephrase it:
> > > How can you know that function does not call an external program to
> > > perform its action?
> >
> > Again, sendfile() is a KERNEL function.
>
> unless you use the syscall macros to do the syscall interrupt yourself,
> you are calling the libc wrapper for the system call, not the system
> call itself.

Right.

And even if you did use the syscall macros, if an attacker has root
it's just as easy for them to intercept the system call as it is to
modify libc or /bin/cp.

That _are_ very good reasons to be wary of calling external programs,
but "because an attacker may have changed the executable" isn't not
the most important.

-- Jamie