From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] vfs: fix linkat error for unprivileged AT_EMPTY_PATH Date: Wed, 24 Sep 2014 20:00:58 +0100 Message-ID: <20140924190058.GE7996@ZenIV.linux.org.uk> References: <20140924152523.GC7441@tucsk.piliscsaba.szeredi.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , "Aneesh Kumar K.V" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Miklos Szeredi Return-path: Content-Disposition: inline In-Reply-To: <20140924152523.GC7441@tucsk.piliscsaba.szeredi.hu> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Sep 24, 2014 at 05:25:23PM +0200, Miklos Szeredi wrote: > From: Miklos Szeredi > > Return proper error value for linkat(..., AT_EMPTY_PATH) without enough > privileges. > > I guess ENOENT was used here, because without AT_EMPTY_PATH that's what > we'd return for an empty path. But it is wrong for AT_EMPTY_PATH, since we > might not even be passing an empty path, we are simply complaining about > lack of privs for which EPERM is the proper error. Umm... Are you sure that nothing in userland is checking for that return value? I agree that EPERM would make more sense, but...