The spoofing is exactly the point. Just because two processes
cooperate doesn't mean they should trust each other. I want a process
serving out file descriptors and it must be able to guarantee the
access rights of the other end. Just as the open(2) syscall doesn't
let you give an argument containing the uid you claim to be, this
mustn't either ;-).
>Note I have no experience where we want to do this...
I'm adding a syscall mask to the kernel and writing wrapper functions
for some syscalls which get their file descriptors from a "virtual
machine" serving daemon which can vet access to files, sockets and
so on. That way, you can run any potentially-unsafe program in a
secure, restricted environment without being restricted to Java,
safeperl, safetcl or whatever and without "buffer overrun" errors
mattering. Because the syscalls are trapped on kernel entry, it
doesn't matter if you can trick the program to execute arbitrary
machine code. Since the syscall mask is kernel code, it's already
Linux-specific so I don't mind too much that the SCM_XRIGHTS
control message is non-portable. Heck, BSD have already changed
the access-rights passing API from 4.3 to 4.4 and since it's now
supposed to be extensible, I don't feel bad about new control
message types. It's analogous to the Linux SOCK_PACKET and other
Linux-specific ioctls.
--Malcolm
-- Malcolm Beattie <mbeattie@sable.ox.ac.uk> Oxford University Computing Services "Widget. It's got a widget. A lovely widget. A widget it has got." --Jack Dee