Firewall Wizards mailing list archives

Re: chroot useful?


From: "Steven M. Bellovin" <smb () research att com>
Date: Sat, 15 Nov 1997 02:06:18 +0000

At 11:24 AM 11/14/97 -0600, Aleph One wrote:
On Fri, 14 Nov 1997, Steven M. Bellovin wrote:

That was precisely my point -- that this opinion is not correct.  There
are numerous ways for root to break out of a chroot() "jail"; the simplest
is to do mknod() to create new special device files for the real disks, and
mount new file systems on those devices.  Many other variants are possible
as well.

Actually the simplest is:

mkdir("foo",S_IRUSR|S_IXUSR);
chroot("foo");
chdir("..");

Yours is certainly simpler to code.  It's not clear that it's simpler to
understand, because it depends on a subtle -- and useful -- point:  a
process's working directory need not be within the chroot() area.  This
can sometimes be a useful property to exploit.



Current thread: