From owner-svn-src-all@freebsd.org Thu Apr 14 00:03:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECECDB0F081; Thu, 14 Apr 2016 00:03:48 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [162.220.209.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "www.gritton.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C2C6814AA; Thu, 14 Apr 2016 00:03:48 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [162.220.209.3]) by gritton.org (8.15.2/8.15.2) with ESMTPS id u3E03fGB013456 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 13 Apr 2016 18:03:42 -0600 (MDT) (envelope-from jamie@freebsd.org) Received: (from www@localhost) by gritton.org (8.15.2/8.15.2/Submit) id u3E03fDU013455; Wed, 13 Apr 2016 18:03:41 -0600 (MDT) (envelope-from jamie@freebsd.org) X-Authentication-Warning: gritton.org: www set sender to jamie@freebsd.org using -f To: Mateusz Guzik Subject: Re: svn commit: r297935 - head/sys/kern X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 13 Apr 2016 18:03:41 -0600 From: James Gritton Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20160413234506.GA20084@dft-labs.eu> References: <201604132014.u3DKEDHv078627@repo.freebsd.org> <20160413234506.GA20084@dft-labs.eu> Message-ID: <96553562c2258a9809499662f43434a6@gritton.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.1.2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2016 00:03:49 -0000 On 2016-04-13 17:45, Mateusz Guzik wrote: > On Wed, Apr 13, 2016 at 08:14:13PM +0000, Jamie Gritton wrote: >> Author: jamie >> Date: Wed Apr 13 20:14:13 2016 >> New Revision: 297935 >> URL: https://svnweb.freebsd.org/changeset/base/297935 >> >> Log: >> Separate POSIX sem/shm objects in jails, by prepending the jail's >> path >> name to the object's "path". While the objects don't have real path >> names, it's a filesystem-like namespace, which allows jails to be >> kept to their own space, but still allows the system / jail parent >> to >> access a jail's IPC. >> > > What is the reasoning behind this method? The reasoning is that even though the namespace isn't the actual filesystem, it's still a filesystem-like namespace, and that provides a good way to let the system communicate with jails if it so chooses (that can be useful) while still keeping jails separate from each other. I assume the fact that sem/shm objects aren't actual vnodes is because it was much easier than making it work (especially in a world of multiple filesystems), and not because it was considered an actual desirable feature. > Names are not supposed to contain slashes apart from the initial > one, so this cuts into the supported length. Actually, for sem/shm objects, multiple slashes are supported, so it looks like a virtual full pathname. And the supported length is in fact MAXPATHLEN. > If slashes were to be > permitted, this would create a possible conflict where part of the name > is the same as the path of a newly created jail. Yes, there is that possible conflict. But since these objects aren't actually in the filesystem, it's permissible to have one at "/jail" at the same time as having another at "/jail/foo/bar". > The standard way would be to provide an entirely separate namespace, if > requested, and keep things the same otherwise. I would have done that had the namespace not already been essentially a poor man's filesystem. But since the goal was obviously filesystem-ish if not the actual filesystem, the most natural way to specify the jail namespace is by using the jail path. Note that the companion commit for the POSIX mqueue objects, does in fact keep the jails totally separate. That's because the mqueue objects are in fact limited to a single "component" (i.e. only one slash). This is not a feature, but rather an implementation deficiency as evidenced by the code in uipc_mqueue.c that handles full paths but is wrapped in "#ifdef notyet". - Jamie