Re: [PATCH] vfs: fix reference leak in d_prune_aliases()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 19, 2014 at 03:50:34PM +0800, Yan, Zheng wrote:
> Signed-off-by: Yan, Zheng <zyan@xxxxxxxxxx>
> ---
>  fs/dcache.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/dcache.c b/fs/dcache.c
> index 3ffef7f..5bc72b0 100644
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -778,6 +778,7 @@ restart:
>  			struct dentry *parent = lock_parent(dentry);
>  			if (likely(!dentry->d_lockref.count)) {
>  				__dentry_kill(dentry);
> +				dput(parent);
>  				goto restart;
>  			}
>  			if (parent)

Good catch...  Applied, will push to Linus.  I'm putting the following as
commit message:

In "d_prune_alias(): just lock the parent and call __dentry_kill()" the old
dget + d_drop + dput has been replaced with lock_parent + __dentry_kill;
unfortunately, dput() does more than just killing dentry - it also drops the
reference to parent.  New variant leaks that reference and needs dput(parent)
after killing the child off.

Is the above OK with you?
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux