Re: [PATCH] new syscall: flink

Malcolm Beattie
2003-04-07T09:00:19Z

David Wagner writes:
> H. Peter Anvin wrote:
> >Alan Cox wrote:
> >> Suppose I give you an O_RDONLY handle to a file which you then
> >> flink and gain write access too ?
> >
> >This, I believe, is the real issue. However, we already have that
> >problem:
>
> No, I don't think we already have that problem. I think flink()
> would introduce a new security hole not already present.

Here's another example along similar lines: you can open a file
O_APPEND and pass the descriptor along to another process (e.g. a
security mediator process that hands out a file descriptor to a
less-trusted recipient that it can use for appending entries only).
fcntl() explicity prevents the clearing of the O_APPEND flag on a
file which was opened with O_APPEND. With flink, one could flink()
and re-open without O_APPEND: security hole.

--Malcolm

--
Malcolm Beattie <mbeattie@clueful.co.uk>