Re: Electrolysis security

Zack Weinberg <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Rob Arnold <[email protected]> wrote:
> > The equivalent is to open the file read-only and then transmit it to
> > the content process with a SCM_RIGHTS (iirc) message on a local
> > domain socket.
> 
> Thanks. Is there a good source of documentation on these APIs? I'm
> looking for an equivalent to MSDN. Bonus points if it covers other
> unixes.

I don't know a consolidated online guide-and-reference equivalent to
MSDN for the Unix APIs.  The GNU libc manual [1] is very good for what
it covers, and generally good at indicating what is portable and what
is GNU-specific.  The Open Group has the text of its various standards
online (free registration required) at [2].  Unfortunately, neither of
these covers transmission of file descriptors between processes.  The
Linux and FreeBSD manpages [3,4] do cover it but not very clearly.

W. Richard Stevens' books [5] are almost certain to cover it, but
that's $170 worth of dead trees. :-/

> > I'd be much more worried about finding ways to disable
> > socket(AF_INET, ...) and friends, and to cut off access to most
> > absolute paths without breaking the C library.
> 
> 
> Right. This is a challenge on Windows (XP only I think) too. Once all
> the shared libraries are loaded, is there any reason that we can't
> chroot the child process (on unix...Windows doesn't have chroot)?

It's a privileged operation on unix, unfortunately.  And there are a
bunch of C library functions that expect to be able to get at files
in /etc, /dev, and /lib, even after the dynamic loader is done.

FreeBSD has jail(), which still requires copying a bunch of stuff into
a private directory tree, but is a lot more flexible than chroot().  On
Linux we might be able to do something with SELinux.  I don't know
about Darwin.

zw

[1] http://www.gnu.org/software/libc/manual/
[2] http://www.opengroup.org/bookstore/catalog/t_c.htm
[3] http://www.kernel.org/doc/man-pages/online/pages/man3/cmsg.3.html
[4] http://www.freebsd.org/cgi/man.cgi?query=recv&sektion=2
[5]
http://www.amazon.com/Unix-Network-Programming-Addison-Wesley-Professional/dp/0131411551/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.