From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH v2] vfs: Tighten up linkat(..., AT_EMPTY_PATH) Date: Mon, 26 Aug 2013 10:37:57 -0700 Message-ID: References: <20130822201530.GL31117@1wt.eu> <20130823010726.GP27005@ZenIV.linux.org.uk> <20130825033741.GX27005@ZenIV.linux.org.uk> <20130825200605.GC27005@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Andy Lutomirski , Willy Tarreau , "security@kernel.org" , Ingo Molnar , Linux Kernel Mailing List , Oleg Nesterov , Linux FS Devel , Brad Spengler To: Al Viro Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sun, Aug 25, 2013 at 1:23 PM, Linus Torvalds wrote: > > So I'll just go back to square one, and wonder if we could/should just > make the rule be that in order to be in that LAST_BIND case, you > really have to have f_cred match your own credentials. Or have > CAP_SEARCH. Nope. That doesn't work. It breaks the chrome sandboxing. Right now, following a /proc fd symlink requires ptrace access to the process. Which is actually pretty strict, and makes sense. But it does mean that there are other capabilities than CAP_DAC_READ_SEARCH at play. I'm playing with a patch that then in addition to the ptrace check *also* requires that the file was opened with the same credentials as the follower _or_ the task being followed. I'll see if that works out. Linus