lkml.org 
[lkml]   [2002]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: can chroot be made safe for non-root?
From
Date
daw@mozart.cs.berkeley.edu (David Wagner) writes:

> Philippe Troin wrote:
> >Eric Buddington <eric@ma-northadams1b-3.bur.adelphia.net> writes:
> >> Would it be reasonable to allow non-root processes to chroot(), if the
> >> chroot syscall also changed the cwd for non-root processes?
> >
> >No.
> >
> > fd = open("/", O_RDONLY);
> > chroot("/tmp");
> > fchdir(fd);
> >
> >and you're out of the chroot.
>
> Irrelevant. If a process *wants* to voluntarily sandbox itself, it can
> close all open file descriptors before sandboxing.

You missed the point.

If the process can be forced to run the above (possibly via a stack
overflow), then it is out of the chroot.

Phil.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:30    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog