From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Weinberger Subject: Re: Intentionally corrupted vfat fs causing BUG Date: Thu, 23 Oct 2014 18:55:46 +0200 Message-ID: <54493312.7070606@nod.at> References: <87h9z97aoh.fsf@devron.myhome.or.jp> <8761fo7667.fsf@devron.myhome.or.jp> <543B8BC7.1040501@nod.at> <87y4sk5pul.fsf@devron.myhome.or.jp> <543B8FA7.9000106@nod.at> <87r3yc5oqt.fsf@devron.myhome.or.jp> <5443E87A.2060207@nod.at> <87oat29551.fsf@devron.myhome.or.jp> <20141023160106.GB7996@ZenIV.linux.org.uk> <20141023161606.GC7996@ZenIV.linux.org.uk> <877fzq91ky.fsf@devron.myhome.or.jp> <8738ae91cw.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Cc: Sami Liedes , linux-fsdevel To: OGAWA Hirofumi , Al Viro Return-path: Received: from a.ns.miles-group.at ([95.130.255.143]:65275 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755326AbaJWQzu (ORCPT ); Thu, 23 Oct 2014 12:55:50 -0400 In-Reply-To: <8738ae91cw.fsf@devron.myhome.or.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Am 23.10.2014 um 18:50 schrieb OGAWA Hirofumi: > OGAWA Hirofumi writes: > >> Al Viro writes: >> >>> On Thu, Oct 23, 2014 at 05:01:06PM +0100, Al Viro wrote: >>> >>>> Hmm... Why hadn't d_splice_alias() caught that, though? >>> >>> Aha. It's not namei_msdos.c part, it's namei_vfat.c one. And there >>> we don't call d_splice_alias() on the affected path... >>> >>> OK, so your check isn't enough. What we need there is this: >>> if (alias && alias->d_parent == dentry->d_parent && ...) >>> Otherwise that d_move() isn't safe at all. >> >> Hm, sounds like I'm missing something. what case has different >> ->d_parent on alias if prevented by my check? > > You meant the case of more complex double linked loop? Yes. This is why I came up with the alias->d_parent == dentry->d_parent check. Thanks, //richard