From owner-freebsd-security@FreeBSD.ORG Fri Aug 23 11:41:47 2013 Return-Path: Delivered-To: freebsd-security@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 334491C4; Fri, 23 Aug 2013 11:41:47 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id E8B22208F; Fri, 23 Aug 2013 11:41:46 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1VCpmQ-000H2x-76; Fri, 23 Aug 2013 15:43:50 +0400 Date: Fri, 23 Aug 2013 15:43:50 +0400 From: Slawa Olhovchenkov To: Konstantin Belousov Subject: Re: Allowing tmpfs to be mounted in jail? Message-ID: <20130823114350.GA64913@zxy.spb.ru> References: <52166351.4030106@delphij.net> <20130822213732.GA4972@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130822213732.GA4972@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: freebsd-fs@FreeBSD.ORG, "freebsd-security@freebsd.org" , d@delphij.net X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 11:41:47 -0000 On Fri, Aug 23, 2013 at 12:37:32AM +0300, Konstantin Belousov wrote: > On Thu, Aug 22, 2013 at 12:15:29PM -0700, Xin Li wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA512 > > > > Hi, > > > > Do anybody have concerns if I would commit this? > > > > Index: sys/fs/tmpfs/tmpfs_vfsops.c > > =================================================================== > > - --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 254663) > > +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) > > @@ -420,4 +420,4 @@ struct vfsops tmpfs_vfsops = { > > .vfs_statfs = tmpfs_statfs, > > .vfs_fhtovp = tmpfs_fhtovp, > > }; > > - -VFS_SET(tmpfs_vfsops, tmpfs, 0); > > +VFS_SET(tmpfs_vfsops, tmpfs, VFCF_JAIL); > > > > Unrestricted tmpfs mounts can easily consume all available memory, > making the host unusable. But the change is probably fine, since > we have global 'disable mount from the jail' flag. tmpfs in jail must use memory limit from rctl memoryuse, I think.