From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH] mnt: Fix a memory stomp in umount Date: Fri, 02 Jan 2015 15:56:40 -0600 Message-ID: <87h9w8sv6v.fsf@x220.int.ebiederm.org> References: <87d27gkia8.fsf@x220.int.ebiederm.org> <87h9wsiwwl.fsf@x220.int.ebiederm.org> <20141218210553.GQ22149@ZenIV.linux.org.uk> <87d27ghd1i.fsf@x220.int.ebiederm.org> <20141219000215.GR22149@ZenIV.linux.org.uk> <87lhlkvqo1.fsf@x220.int.ebiederm.org> <20150102211303.GU22149@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain Cc: Linus Torvalds , linux-fsdevel To: Al Viro Return-path: Received: from out01.mta.xmission.com ([166.70.13.231]:34216 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752093AbbABV7S (ORCPT ); Fri, 2 Jan 2015 16:59:18 -0500 In-Reply-To: <20150102211303.GU22149@ZenIV.linux.org.uk> (Al Viro's message of "Fri, 2 Jan 2015 21:13:03 +0000") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Al Viro writes: > On Fri, Jan 02, 2015 at 03:06:06PM -0600, Eric W. Biederman wrote: > >> - It requires keeping track of the tail of the list which is half of the >> error prone complexity. > > Er... In umount_tree() it comes pretty much for free, actually. The runtime complexity is basically free. The conceptual complexity is not. It is yet another detail to pay attention to. Having gotten it wrong my first round while trying to do something similar while developing my patches I can attest to this. The hlist version is more error prone to use and develop against. (Even if appropriate helpers are available). >> - I have a fix for a bad interaction between MNT_LOCKED and MNT_DETACH >> where I need to leave mounts on the mount hash, until the final >> mntput. For that I need not to reuse the the mnt_hash lists. > > Details, please. The code doing that has been sent out for review. Eric