lkml.org 
[lkml]   [2017]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 3/3] VFS: close race between getcwd() and d_move()
On Fri, Nov 10, 2017 at 08:53:28PM +0000, Al Viro wrote:
> On Fri, Nov 10, 2017 at 03:45:41PM +1100, NeilBrown wrote:
> > -void __d_drop(struct dentry *dentry)
> > +static void ___d_drop(struct dentry *dentry)
> > {
> > if (!d_unhashed(dentry)) {
> > struct hlist_bl_head *b;
> > @@ -486,12 +488,15 @@ void __d_drop(struct dentry *dentry)
> >
> > hlist_bl_lock(b);
> > __hlist_bl_del(&dentry->d_hash);
> > - dentry->d_hash.pprev = NULL;
> > hlist_bl_unlock(b);
> > /* After this call, in-progress rcu-walk path lookup will fail. */
> > write_seqcount_invalidate(&dentry->d_seq);
> > }
> > }
> > +void __d_drop(struct dentry *dentry) {
> > + ___d_drop(dentry);
> > + dentry->d_hash.pprev = NULL;
>
> Umm... That reordering (unhashed vs. ->d_seq) might be a problem
> on the RCU side. I'm not sure it is, we might get away with that,
> actually, but I want to finish digging through the pathwalk-related
> code. Cursing it for being too subtle for its own good, as usual...

OK, I believe that it's survivable, but I'd prefer to keep in -next
for a while and give it more testing.

\
 
 \ /
  Last update: 2017-11-22 00:51    [W:0.059 / U:0.908 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site