From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oren Laadan Subject: Re: [patch 1/2] [RFC] Simple tamper-proof device filesystem. Date: Mon, 17 Dec 2007 20:39:47 -0500 Message-ID: <476724E3.6060901@cs.columbia.edu> References: <20071216080441.435456586@I-love.SAKURA.ne.jp> <20071216080628.061470932@I-love.SAKURA.ne.jp> <200712161944.HEI26071.MOtOFLVHFSQFOJ@I-love.SAKURA.ne.jp> <200712161956.BJE32406.FOOHtQJLMFOSVF@I-love.SAKURA.ne.jp> <20071217194802.GA14156@sergelap.austin.ibm.com> <200712180003.lBI03N7F092396@www262.sakura.ne.jp> <20071218003955.GA27048@sergelap.austin.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Tetsuo Handa , linux-fsdevel@vger.kernel.org, Linux Containers , linux-kernel@vger.kernel.org To: "Serge E. Hallyn" Return-path: In-Reply-To: <20071218003955.GA27048@sergelap.austin.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org I hate to bring this again, but what if the admin in the container mounts an external file system (eg. nfs, usb, loop mount from a file, or via fuse), and that file system already has a device that we would like to ban inside that container ? Since anyway we will have to keep a white- (or black-) list of devices that are permitted in a container, and that list may change even change per container -- why not enforce the access control at the VFS layer ? It's safer in the long run. Oren. Serge E. Hallyn wrote: > Quoting Tetsuo Handa (penguin-kernel@i-love.sakura.ne.jp): >> Hello. >> >> Serge E. Hallyn wrote: >>> CAP_MKNOD will be removed from its capability >> I think it is not enough because the root can rename/unlink device files >> (mv /dev/sda1 /dev/tmp; mv /dev/sda2 /dev/sda1; mv /dev/tmp /dev/sda2). > > Sure but that doesn't bother us :) > > The admin in the container has his own /dev directory and can do what he > likes with the devices he's allowed to have. He just shouldn't have > access to others. If he wants to rename /dev/sda1 to /dev/sda5 that's > his choice. > >>> To use your approach, i guess we would have to use selinux (or tomoyo) >>> to enforce that devices may only be created under /dev? >> Everyone can use this filesystem alone. > > Sure but it is worthless alone. > > No? > > What will keep the container admin from doing 'mknod /root/hda1 b 3 1'? > >> But use with MAC (or whatever access control mechanisms that prevent >> attackers from unmounting/overlaying this filesystem) is recomennded. > > -serge > _______________________________________________ > Containers mailing list > Containers@lists.linux-foundation.org > https://lists.linux-foundation.org/mailman/listinfo/containers