Re: can chroot be made safe for non-root?

Bernd Eckenfels (ecki-news2002-09@lina.inka.de)
Sun, 20 Oct 2002 12:40:04 +0200


In article <200210191942.g9JJg2U26376@marc2.theaimsgroup.com> you wrote:
> directory (I decided against making the chroot call fail, as any software
> buggy enough to chroot with open directory fds is likely to not check the
> return value of chroot(2), and blindly continue on failure--even worse).
> I'd be happy to hear about (and fix ;) anything I've missed.

One idea would be to sigsegv the program which is doing a chroot with open
fds :)

> IIRC, FreeBSD allow a chroot'ed process to chroot again if and only if
> the
> new root is a subdirectory of the initial chroot. This allows things
> like
> traditional, chrooting anonymous FTP to be run under an initial chroot.

well, you can only changeroot in a subdir anyway, so this is not the point
that freebsd is allowing a chroot in a chroot. As far as I know they simply
solved the break out issue.

BTW: kill on open fd would solve the breakout issue, too.

Greetings
Bernd
-
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/