From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [patch 2/2] fs, proc: Introduce the /proc//map_files/ directory v12 Date: Wed, 14 Sep 2011 15:39:12 +0400 Message-ID: <20110914113912.GQ25367@sun> References: <20110913211359.674453213@openvz.org> <20110913212447.918816776@openvz.org> <20110913235222.043927b3.akpm@linux-foundation.org> <20110914105607.GP25367@sun> <20110914111437.GA22516@atrey.karlin.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , linux-kernel@vger.kernel.org, containers@lists.osdl.org, linux-fsdevel@vger.kernel.org, Kirill Shutemov , Pavel Emelyanov , James Bottomley , Nathan Lynch , Zan Lynx , Daniel Lezcano , Vasiliy Kulikov , Tejun Heo , Alexey Dobriyan , Al Viro , Andrew Morton To: Pavel Machek Return-path: Received: from mail-bw0-f46.google.com ([209.85.214.46]:45897 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932143Ab1INLjT (ORCPT ); Wed, 14 Sep 2011 07:39:19 -0400 Content-Disposition: inline In-Reply-To: <20110914111437.GA22516@atrey.karlin.mff.cuni.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Sep 14, 2011 at 01:14:38PM +0200, Pavel Machek wrote: > Hi! > ... > > > > Pavel, I somehow lost. What exactly the security issue here? There are a few > > patches from Vasiliy in -mm queue at moment. In particular one includes > > .permission set for fd/ handling. So I've updated the map_files as well > > (it's below). So please review and point me where the problem > > is. Thanks! > > AFAICT, this recreates existing problem with /proc//fd (see > discussion at > > http://www.securityfocus.com/archive/1/507386/30/0/threaded > > ). It creates object that looks like symlink, but does not behave as > one, and permissions of directories are not checked as they would be > if it was a symlink. > > Pavel OK, so the problem is that we might return a path to the file mapped even if the directory which consists the former file has its permission changed, right? For example, lets say we have | lr-x------ 1 cyrill cyrill 64 Sep 14 19:35 /proc/self/map_files/3d73a00000-3d73a1c000 -> /lib64/ld-2.5.so and once /lib64 became unreadable we should not return the path to 3d73a00000-3d73a1c000 as well, that is what you mean, right? Cyrill