From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756096AbcHBHA2 (ORCPT ); Tue, 2 Aug 2016 03:00:28 -0400 Received: from s3.sipsolutions.net ([5.9.151.49]:39412 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752509AbcHBHAT (ORCPT ); Tue, 2 Aug 2016 03:00:19 -0400 Message-ID: <1470117018.2665.1.camel@sipsolutions.net> Subject: Re: [PATCH] 9p: don't use v9fs_parent_fid() when v9fs_fid_clone() is needed From: Johannes Berg To: Al Viro Cc: v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Date: Tue, 02 Aug 2016 07:50:18 +0200 In-Reply-To: <20160802003014.GD2356@ZenIV.linux.org.uk> References: <1470081437-5008-1-git-send-email-johannes@sipsolutions.net> <20160802003014.GD2356@ZenIV.linux.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.2-2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-08-02 at 01:30 +0100, Al Viro wrote: > On Mon, Aug 01, 2016 at 09:57:17PM +0200, Johannes Berg wrote: > > The introduction of v9fs_parent_fid() broke v9fs_vfs_rename() > > since that doesn't just do v9fs_fid_lookup() but rather uses > > v9fs_fid_clone() on the ->d_parent. > > > > I suppose it'd be possible to introduce v9fs_clone_parent_fid() > > but I decided that just reverting the broken change was better > > for now. > > Sorry for the braino; FWIW, I'd rather add > > static inline struct p9_fid *fid_clone(struct p9_fid *fid) > { > if (IS_ERR(fid)) > return fid; > return p9_client_walk(fid, 0, NULL, 1); > } > > and turn those into fid_clone(v9fs_parent_fid(old_dentry)), etc. That would have required much more looking into what happens than I was about to do :) >   Has an extra benefit of simplifying several other places.  I'll fix > and post (with credits to you for spotting the bug in question, of > course). No objection, I just did the minimum necessary to make my setup not crash on use-after-free all the time (thanks to slab debug) :) Thanks, johannes