From mboxrd@z Thu Jan 1 00:00:00 1970 From: Willy Tarreau Subject: Re: [PATCH v2] vfs: Tighten up linkat(..., AT_EMPTY_PATH) Date: Thu, 22 Aug 2013 22:15:30 +0200 Message-ID: <20130822201530.GL31117@1wt.eu> References: <20130822185317.GI31117@1wt.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , "security@kernel.org" , Ingo Molnar , Linux Kernel Mailing List , Oleg Nesterov , Al Viro , 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 Thu, Aug 22, 2013 at 01:10:43PM -0700, Andy Lutomirski wrote: > What's the point of nd_jump_link anyway? The only way I can think of > for a magic symlink in /proc to point to another symlink is to open a > symlink with O_PATH | O_NOFOLLOW. Actually trying to use the > resulting link in /proc results in -ELOOP. (Even just trying to open > a normal symlink with O_NOFOLLOW and without O_PATH results in > -ELOOP.) It's not only that, it also supports sockets and pipes that you can access via /proc/pid/fd and not via a real symlink which would try to open eg "pipe:[23456]" instead of the real file. So you can't get rid of it without breaking existing apps (starting with your shell for which /dev/stdin is a link to /proc/self/fd/0 for example). Willy