From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH v2] vfs: Tighten up linkat(..., AT_EMPTY_PATH) Date: Sun, 25 Aug 2013 15:23:07 +0100 Message-ID: <20130825142307.GA27005@ZenIV.linux.org.uk> References: <20130822201530.GL31117@1wt.eu> <20130823010726.GP27005@ZenIV.linux.org.uk> <20130825033741.GX27005@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , Willy Tarreau , "security@kernel.org" , Ingo Molnar , Linux Kernel Mailing List , Oleg Nesterov , Linux FS Devel , Brad Spengler To: Andy Lutomirski Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sun, Aug 25, 2013 at 12:26:34AM -0700, Andy Lutomirski wrote: > I think this is more screwed up than just flink and open. For example: > > $ echo 'WTF' >test > $ truncate -s 1 /proc/self/fd/3 3 $ cat test > W$ > > IMO that should have failed. Why? truncate() always follows links, so what's the problem with that one? That you get checks of truncate() and not ftruncate()? > In an ideal world (I think) ffrob(N), frobat(N, "", AT_EMPTY_PATH), > and frobat(AT_FDCWD, "/proc/self/fd/N) should generally do the same > thing. What about the cases where frob() and ffrob() check for different things?