Re: dcache shrink list corruption?

From: Linus Torvalds
Date: Wed Apr 30 2014 - 16:23:32 EST


On Wed, Apr 30, 2014 at 12:59 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
> Another thing: I don't like what's going on with freeing vs. ->d_lock there.
> Had that been a mutex, we'd definitely get a repeat of "vfs: fix subtle
> use-after-free of pipe_inode_info". The question is, can spin_unlock(p)
> dereference p after another CPU gets through spin_lock(p)? Linus?

spin_unlock() *should* be safe wrt that issue.

But I have to say, I think paravirtualized spinlocks may break that.
They do all kinds of "kick waiters" after releasing the lock.

Doesn't the RCU protection solve that, though? Nobody should be
releasing the dentry under us, afaik..

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/