summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbcr <bcr@FreeBSD.org>2011-05-08 12:16:39 +0000
committerbcr <bcr@FreeBSD.org>2011-05-08 12:16:39 +0000
commitc6debcf559ce1a70224acaefc5b1d3e8ae3b1c77 (patch)
tree00396dca001e7ca7fd54e642753f3e88bb89c65b /usr.sbin
parent37c4b4161f69961dbcefc2220e7a0468fb4d1387 (diff)
downloadFreeBSD-src-c6debcf559ce1a70224acaefc5b1d3e8ae3b1c77.zip
FreeBSD-src-c6debcf559ce1a70224acaefc5b1d3e8ae3b1c77.tar.gz
Jails have a problem in that if the jail directory is world-readable,
an attacker with root access to the jail can create a setuid binary for their own use in the host environment (if they also have this access), thus breaking root in the host. This exploit is impossible if the jail's files are not world-readable. Add instructions to the man page on how to create a jail with the correct permissions set. PR: docs/156853 Submitted by: Chris Rees (utisoft at gmail dot com) Reviewed by: cperciva (security parts) MFC after: 9 days
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/jail/jail.88
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8
index 893efd84..b3f0b03 100644
--- a/usr.sbin/jail/jail.8
+++ b/usr.sbin/jail/jail.8
@@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 17, 2010
+.Dd May 8, 2011
.Dt JAIL 8
.Os
.Sh NAME
@@ -431,7 +431,7 @@ command script can be used:
.Bd -literal
D=/here/is/the/jail
cd /usr/src
-mkdir -p $D
+mkdir -p -m 0700 $D
make world DESTDIR=$D
make distribution DESTDIR=$D
mount -t devfs devfs $D/dev
@@ -448,6 +448,10 @@ in the per-jail devfs.
A simple devfs ruleset for jails is available as ruleset #4 in
.Pa /etc/defaults/devfs.rules .
.Pp
+Non-superusers in the host system should not be able to access the
+jail's files; otherwise an attacker with root access to the jail
+could obtain elevated privileges on the host.
+.Pp
In many cases this example would put far more in the jail than needed.
In the other extreme case a jail might contain only one file:
the executable to be run in the jail.
OpenPOWER on IntegriCloud