From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Bodo Eggert " <7eggert@gmx.de> Subject: Re: [RFC] FUSE permission modell (Was: fuse review bits) Date: Wed, 20 Apr 2005 21:52:31 +0200 Message-ID: References: <3UrQt-2Js-3@gated-at.bofh.it> <3SpIW-6UA-17@gated-at.bofh.it> <3SpIW-6UA-19@gated-at.bofh.it> <3SpIW-6UA-21@gated-at.bofh.it> <3UrQt-2Js-5@gated-at.bofh.it> <3UrQt-2Js-1@gated-at.bofh.it> <3UZyS-55i-39@gated-at.bofh.it> <3V2wG-7HR-19@gated-at.bofh.it> <3V2PX-7Vh-23@gated-at.bofh.it> <3V6Ae-2Ce-17@gated-at.bofh.it> <3V6JW-2K9-49@gated-at.bofh.it> <3VeHl-NF-3@gated-at.bofh.it> Reply-To: 7eggert@gmx.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Return-path: Received: from mail-in-09.arcor-online.net ([151.189.21.49]:9660 "EHLO mail-in-09.arcor-online.net") by vger.kernel.org with ESMTP id S261739AbVDTTxK (ORCPT ); Wed, 20 Apr 2005 15:53:10 -0400 To: Mike Waychison , Eric Van Hensbergen , Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, akpm@osdl.org, viro@parcelfarce.linux.theplanet.co.uk Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Mike Waychison wrote: > Consider the following pseudo example: > > main(): > chdir("/"); > fd = open(".", O_RDONLY); > clone(cloned_func, cloned_stack, CLONE_NEWNS, NULL); > > cloned_func: > fchdir(fd); > chdir(".."); > > if main is run within a chroot where it's "/" is on the same vfsmount as > it's "..", then the application can step out of the chroot using clone(2). > > Note: using chdir in a vfsmount outside of your namespace works, however > you won't be able to walk off that vfsmount (to its parent or children). IMO the '..' file descriptor should be attached to it's chroot domain. This should avoid all chroot-escapes, even with fd-passing etc. I wonder why nobody thought of that. Either it's too obvious or too stupid. -- Funny quotes: 7. You have the right to remain silent. Anything you say will be misquoted, then used against you.