[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210825052900.GA26714@lst.de>
Date: Wed, 25 Aug 2021 07:29:00 +0200
From: Christoph Hellwig <hch@....de>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Christoph Hellwig <hch@....de>,
"Gong, Sishuai" <sishuai@...due.edu>,
"jlbec@...lplan.org" <jlbec@...lplan.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] configfs: fix a race in configfs_lookup()
On Wed, Aug 25, 2021 at 05:19:04AM +0000, Al Viro wrote:
> On Mon, Aug 23, 2021 at 07:08:47PM +0200, Christoph Hellwig wrote:
>
> > We can't hold a spinlock over inode allocation. So it would have to be
> > something like this:
>
> Check for -ENAMETOOLONG first; easier for analysis that way.
Indeed.
> > + dentry->d_fsdata = configfs_get(sd);
> > + sd->s_dentry = dentry;
> > + spin_unlock(&configfs_dirent_lock);
> >
> > - found = 1;
> > - err = configfs_attach_attr(sd, dentry);
> > - break;
> > + inode = configfs_create(dentry, mode);
> > + if (IS_ERR(inode)) {
> > + configfs_put(sd);
> > + return ERR_CAST(inode);
>
> Er... Won't that leave dentry with dangling ->d_fsdata?
Yes. Existing problem, though.
Powered by blists - more mailing lists