[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
chroot pseudo jail
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: chroot pseudo jail
- From: Ted Unangst <tedu_(_at_)_stanford_(_dot_)_edu>
- Date: Thu, 10 Apr 2003 19:47:12 -0700 (PDT)
there's been some interest in a chroot call that does more than man chroot
tells you it should do. this is a little patch adding a jail syscall.
every process that calls jail gets a new jailid, inherited by children.
jail also performs chroot, with a forced chdir.
if you have been jailed, you cannot:
- see other procs
- send them signals
- manipulate shared memory
- probably some other stuff
unless jailids match.
controlled by option JAIL. extra options: JAIL_CHROOT turns chroot into
jail, and JAIL_ONCE prevents a jailed process from calling jail again.
it's not FreeBSD jail, though somebody could extend it without much
difficulty to cover networking code too probably. the double chroot
tricks still work without JAIL_ONCE; i didn't feel like writing the code
to make it not happen. you have to rebuild ps and the usual suspects.
it hasn't really been tested, so it's likely this will break something.
chroot and jail aren't the types of things that make me want to stay up
late, so take it or leave it. this is a defence against attacks that have
never been demonstrated, are entirely theoretical, and terribly difficult.
license: by downloading the following patch, you agree to never send
me an email again. :)
"What right does Congress have to go around making laws just because
they deem it necessary?"
- M. Barry, Mayor of Washington, DC
Visit your host, monkey.org