From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f67.google.com ([209.85.218.67]:36754 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754515AbdCILNb (ORCPT ); Thu, 9 Mar 2017 06:13:31 -0500 Received: by mail-oi0-f67.google.com with SMTP id a144so4339515oib.3 for ; Thu, 09 Mar 2017 03:13:30 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20170219032743.GH29622@ZenIV.linux.org.uk> References: <1484588765-9397-1-git-send-email-amir73il@gmail.com> <1484588765-9397-2-git-send-email-amir73il@gmail.com> <20170219032743.GH29622@ZenIV.linux.org.uk> From: Miklos Szeredi Date: Thu, 9 Mar 2017 12:13:29 +0100 Message-ID: Subject: Re: [PATCH v3 1/6] vfs: create vfs helper vfs_tmpfile() To: Al Viro Cc: Amir Goldstein , "linux-unionfs@vger.kernel.org" , linux-fsdevel@vger.kernel.org, "Eric W. Biederman" Content-Type: text/plain; charset=UTF-8 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun, Feb 19, 2017 at 4:27 AM, Al Viro wrote: > On Mon, Jan 16, 2017 at 08:47:32PM +0100, Miklos Szeredi wrote: > >> > + umode_t mode, int open_flag) >> > +{ >> > + static const struct qstr name = QSTR_INIT("/", 1); >> > + struct dentry *child = NULL; >> > + struct inode *inode; >> > + int error; >> > + >> > + /* we want directory to be writable */ >> > + error = inode_permission(dir, MAY_WRITE | MAY_EXEC); >> >> This is not in the scope of this patch, but shoudln't we be using >> may_create() here? Or at least a variant without the audit thing... >> >> Al? > > may_create() expects directory + child dentry; here we have only parent. > IS_DEADDIR is rather pointless here - directory is not locked, for > starters, so rmdir might happen right under you. Or right after you've > returned from your function, for that matter. userns checks... > FWIW, no such checks are done in ->atomic_open() paths, so I'm not sure > how much are those worth... Eric would know since he added those checks. Thanks, Miklos