From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m12-14.163.com ([220.181.12.14]:52170 "EHLO m12-14.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbeKYLBO (ORCPT ); Sun, 25 Nov 2018 06:01:14 -0500 Date: Sun, 25 Nov 2018 08:11:33 +0800 From: PanBian To: Al Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.or Subject: Re: [PATCH] namei: free new_dentry late Message-ID: <20181125001133.GA76098@bp> Reply-To: PanBian References: <1543051404-42498-1-git-send-email-bianpan2016@163.com> <20181124195117.GB2217@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181124195117.GB2217@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, Nov 24, 2018 at 07:51:17PM +0000, Al Viro wrote: > On Sat, Nov 24, 2018 at 05:23:24PM +0800, Pan Bian wrote: > > After calling dput(new_dentry), new_dentry is passed to fsnotify_move. > > This may result in a use-after-free bug. This patch moves the put > > operation late. > > > > Fixes: 49d31c2f389a("dentry name snapshots") > > What does that commit have to do with anything? The broken part is > fsnotify_move(new_dir, old_dir, old_dentry->d_name.name, > new_is_dir, NULL, new_dentry); > and it predates that commit by 3 years - it came from da1ce0670c14 ("vfs: add > cross-rename")... Thank you for pointing out my mistake! I will correct it and resubmit the patch! Best regards, Pan