Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1428974

Re: [PATCH 5/8] fuse: don't use ->d_time

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH 5/8] fuse: don't use ->d_time
Date 2016-06-22 18:50 +0200
Message-ID <rMTvJ-5UI-61@gated-at.bofh.it> (permalink)
References <rMRtT-4E1-3@gated-at.bofh.it> <rMRtT-4E1-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jun 22, 2016 at 04:35:07PM +0200, Miklos Szeredi wrote:
> Store in memory pointed to by ->d_fsdata.  Use ->d_allocate() to allocate
> the storage.
> 
> We could cast ->d_fsdata directly on 64bit archs, but I don't think this is
> worth the extra complexity.

Now, _that_ is interesting:

> +static void fuse_dentry_release(struct dentry *dentry)
> +{
> +	kfree(dentry->d_fsdata);
> +}

What happens to fuse_dentry_revalidate() called on dentry in process of
getting dropped?  Unlike freeing struct dentry itself, ->d_release() is
not RCU-delayed.  So you are risking dereference of ->d_fsdata after
kfree(); at the very least, it needs RCU-delayed freeing...

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 5/8] fuse: don't use ->d_time Miklos Szeredi <mszeredi@redhat.com> - 2016-06-22 16:40 +0200
  Re: [PATCH 5/8] fuse: don't use ->d_time Al Viro <viro@ZenIV.linux.org.uk> - 2016-06-22 18:50 +0200

csiph-web