Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3827318imu; Sat, 24 Nov 2018 11:52:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/XGtbw8rCKFehk890KWjodvCe8YvhHzcCdP4SLkZG+iI1WstQK/QMf5QvD8W+gnYyy5/HHO X-Received: by 2002:a62:7086:: with SMTP id l128mr1102159pfc.68.1543089129190; Sat, 24 Nov 2018 11:52:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543089129; cv=none; d=google.com; s=arc-20160816; b=G3WUDaBujE4+9gcHuJ2QP/J0NvHUG9AwT1fdAfYna6pBuGfXki7qiTUntrVxlYN8dx Gez2uzUtBxdb1WEBwDqkpu2Efx564VNJEcaA5bD/5jsGtACmkpBacjrQoL82NhybNSs5 R/iPOBb2iYommaPGLiVQbZFW056pm3V4mfWmuwf31w0Xx2sC0OX9C1CdPPgJPY7DKqrY C5ni9eu0uDC55+HwD4+edMSpNaYT86jevdezO4ZE2AjbxDrGS6EYMjOf/XR7NMPUB7vU mmzA3jXgulmNijlnwnO1sFR4SV2RiVthgVj7PuTLP8whKN7lpUh+pInv10SHl18A96xh 0K7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kpnKQ5w1QOJqhhF07qqj3AcxsP1SiuyayuZFpG0y2J0=; b=PUrFrc31z2K0dDQu+OeomjZYaEg+zukItSmTixjiZy+pY2Qv0vAECjhvEj7D27gT/x VykFVIVSWLiLVmwTxS1cY7MN5WgLOmKVtDFLGZeh4YDYz9PLfC7YJuEcBi7xBRhETNEY l1hdcgY9JJ7vQ+TedKQVvU8haVsbkb7vdU3QL4KyOQbImoXm3JuV4gid1khqTC0OmA6x PucS9HVnmwe09uNecR8pbSeOuc8QUb5zpDLCFQFPxu1rY+WgWpVonndGZLLaxWxshG4d NfQRoVR1hnT+qoJk3n6XaIDvNGpcd2bJjJG+aJ67fVzyYXKnba3KO2fwzyGy6sJ6xAdH FKRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn22si5063933plb.19.2018.11.24.11.51.54; Sat, 24 Nov 2018 11:52:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726251AbeKYGk3 (ORCPT + 99 others); Sun, 25 Nov 2018 01:40:29 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:52070 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbeKYGk3 (ORCPT ); Sun, 25 Nov 2018 01:40:29 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.91 #2 (Red Hat Linux)) id 1gQdxV-00069L-Dc; Sat, 24 Nov 2018 19:51:17 +0000 Date: Sat, 24 Nov 2018 19:51:17 +0000 From: Al Viro To: Pan Bian Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] namei: free new_dentry late Message-ID: <20181124195117.GB2217@ZenIV.linux.org.uk> References: <1543051404-42498-1-git-send-email-bianpan2016@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1543051404-42498-1-git-send-email-bianpan2016@163.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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")...