From owner-svn-src-stable@FreeBSD.ORG Tue Aug 25 15:54:54 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F37C610656C3; Tue, 25 Aug 2009 15:54:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E12B78FC20; Tue, 25 Aug 2009 15:54:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7PFsrZJ032505; Tue, 25 Aug 2009 15:54:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7PFsrRQ032504; Tue, 25 Aug 2009 15:54:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200908251554.n7PFsrRQ032504@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 25 Aug 2009 15:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196544 - in stable/7: sys sys/contrib/pf sys/kern usr.bin/cpuset usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 15:54:54 -0000 Author: bz Date: Tue Aug 25 15:54:52 2009 New Revision: 196544 URL: http://svn.freebsd.org/changeset/base/196544 Log: Backout r191596: Document an issue of jail(8) in conjunction with cpuset(1). MFC r191639: Prevent a superuser inside a jail from modifying the dedicated root cpuset of that jail. Processes inside the jail will still be able to change child sets. A superuser outside of a jail will still be able to change the jail cpuset and thus limit the number of cpus available to the jail. Problem reported by: 000.fbsd@quip.cz (Miroslav Lachman) PR: kern/134050 Reviewed by: jeff Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_cpuset.c stable/7/usr.bin/cpuset/cpuset.1 stable/7/usr.sbin/jail/jail.8 Modified: stable/7/sys/kern/kern_cpuset.c ============================================================================== --- stable/7/sys/kern/kern_cpuset.c Tue Aug 25 14:08:33 2009 (r196543) +++ stable/7/sys/kern/kern_cpuset.c Tue Aug 25 15:54:52 2009 (r196544) @@ -357,6 +357,15 @@ cpuset_modify(struct cpuset *set, cpuset if (error) return (error); /* + * In case we are called from within the jail + * we do not allow modifying the dedicated root + * cpuset of the jail but may still allow to + * change child sets. + */ + if (jailed(curthread->td_ucred) && + set->cs_flags & CPU_SET_ROOT) + return (EPERM); + /* * Verify that we have access to this set of * cpus. */ Modified: stable/7/usr.bin/cpuset/cpuset.1 ============================================================================== --- stable/7/usr.bin/cpuset/cpuset.1 Tue Aug 25 14:08:33 2009 (r196543) +++ stable/7/usr.bin/cpuset/cpuset.1 Tue Aug 25 15:54:52 2009 (r196544) @@ -177,9 +177,3 @@ command first appeared in .Fx 7.1 . .Sh AUTHORS .An Jeffrey Roberson Aq jeff@FreeBSD.org -.Sh BUGS -At the moment it is possible for a superuser inside a -.Xr jail 8 -to modify the root -.Xr cpuset 2 -of that jail. Modified: stable/7/usr.sbin/jail/jail.8 ============================================================================== --- stable/7/usr.sbin/jail/jail.8 Tue Aug 25 14:08:33 2009 (r196543) +++ stable/7/usr.sbin/jail/jail.8 Tue Aug 25 15:54:52 2009 (r196544) @@ -699,9 +699,3 @@ Currently, the simplest answer is to min offered on the host, possibly limiting it to services offered from .Xr inetd 8 which is easily configurable. -.Pp -At the moment it is possible for a superuser inside a -.Nm -to modify the root -.Xr cpuset 2 -of that jail.