mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: prevent breaking a chroot() jail?
Date: 5 Jul 2002 11:15:39 -0700	[thread overview]
Message-ID: <ag4nob$sgq$1@cesium.transmeta.com> (raw)
In-Reply-To: <1025877004.11004.59.camel@zaphod>

Followup to:  <1025877004.11004.59.camel@zaphod>
By author:    Shaya Potter <spotter@cs.columbia.edu>
In newsgroup: linux.dev.kernel
>
> I'm trying to develop a way to ensure that one can't break out of a
> chroot() jail, even as root.  I'm willing to change the way the syscalls
> work (most likely only for a subset of processes, i.e. processes that
> are run in the jail end up getting a marker which is passed down to all
> their children that causes the syscalls to behave differently).
> 
> What should I be aware of?  I figure devices (no need to run mknod in
> this jail) and chroot (as per man page), is there any other way of
> breaking the chroot jail (at a syscall level or otherwise)?
> 
> or is this 100% impossible?
> 

This sounds like a job for [dum de dum dum] capabilities... remember,
on Linux root hasn't been almighty for a very long time, it's just a
matter of which capabilities you retain.  Of course, if you really
want to be safe, you might end up with a rather castrated root inside
the chroot shell.

If you really want to jail something, use UML.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

  parent reply	other threads:[~2002-07-05 18:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-05 13:50 Shaya Potter
2002-07-05 14:02 ` Miquel van Smoorenburg
2002-07-05 14:37   ` Shaya Potter
2002-07-05 16:14     ` Jesse Pollard
2002-07-05 21:00     ` David Wagner
2002-07-05 22:26       ` Martin Josefsson
2002-07-05 14:15 ` Thunder from the hill
2002-07-05 15:17 ` Vance Lankhaar
2002-07-05 18:15 ` H. Peter Anvin [this message]
2002-07-05 18:45   ` Ville Herva
2002-07-05 21:15     ` Alan Cox
2002-07-05 21:48     ` Jeff Dike
2002-07-05 21:07       ` Ville Herva
2002-07-05 21:35 ` Alan Cox
2002-07-09  3:07 ` Pavel Machek
2002-07-05 15:16 Hank Leininger
2002-07-05 16:17 ` Ville Herva
2002-07-09 13:41   ` Bill Davidsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ag4nob$sgq$1@cesium.transmeta.com' \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®