From owner-freebsd-current@FreeBSD.ORG Tue Apr 4 10:08:02 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9437C16A420; Tue, 4 Apr 2006 10:08:02 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail16.syd.optusnet.com.au (mail16.syd.optusnet.com.au [211.29.132.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2B7A43D64; Tue, 4 Apr 2006 10:07:53 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail16.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k34A7pwx006804 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 4 Apr 2006 20:07:51 +1000 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.4/8.13.4) with ESMTP id k34A7oUe091232; Tue, 4 Apr 2006 20:07:50 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.4/8.13.4/Submit) id k34A7o3X091231; Tue, 4 Apr 2006 20:07:50 +1000 (EST) (envelope-from peter) Date: Tue, 4 Apr 2006 20:07:50 +1000 From: Peter Jeremy To: Robert Watson Message-ID: <20060404100750.GG683@turion.vk2pj.dyndns.org> References: <20060403003318.K947@ganymede.hub.org> <20060403163220.F36756@fledge.watson.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060403163220.F36756@fledge.watson.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 Cc: freebsd-current@freebsd.org, freebsd-stable@freebsd.org Subject: Re: new feature: private IPC for every jail X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Apr 2006 10:08:02 -0000 On Mon, 2006-Apr-03 16:34:59 +0100, Robert Watson wrote: >(2) The name space model for system v ipc is flat, so while it's desirable >to > allow the administrator in the host environment to monitor and control > resource use in the jail (for example, delete allocated but unused > segments), doing that requires developing an administrative model for > it. The SysV SHM name space is made up of a 32-bit user-selected key which is mapped into a 32-bit (system chosen) identifier, which (on FreeBSD) is made up of a 16-bit pool identifier (in the range 0..shmmni-1) and a 16-bit generation counter. At the expense of restricting shmmni, the generation counter and JAIL_MAX, it would seem possible to embed prison.pr_id into the shmid and treat pr_id as an (implicit) part of the key - insisting they must match for jailed processes. Since the name space remains the same, ipcs and ipcrm would not be affected and a non-jailed ipcrm could delete jailed IPC by identifier. On the surface, this approach looks easier than having a distinct name space associated with each prison (as per kern/48471) and has the advantage of allowing non-jailed processes to manage jailed IPC. The disadvantage is restricting the ranges of various counters - though I believe they are overly generous by default. This doesn't really address the problem of SysV IPC and jails becoming more intimately entwined. -- Peter Jeremy