Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3671470ima; Tue, 23 Oct 2018 09:23:10 -0700 (PDT) X-Google-Smtp-Source: AJdET5eswKZ62m7kjOhQ3D1cOd5hTZXEt1FI48VaH/Z7Xr8xp9sqI0QCP6eWdZ064vvNK47DxmvH X-Received: by 2002:a63:fc63:: with SMTP id r35-v6mr12414935pgk.75.1540311790606; Tue, 23 Oct 2018 09:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540311790; cv=none; d=google.com; s=arc-20160816; b=q/rTdd+9wH3jU+hG+8vdEpwMa8bgXdiY8ylGVqCh2huAJdt2w/6n/bXtsaQGAJDApX Ovtw8tWb1P58PnZU0bDR9WI2WIeY5+DqvqWgABylSYz0WUk3GH3PIFYN00vyrPg86RS+ 7Z+dt6TnXrBMtys7pKge9UbWjfKRc4rJxKL5llL7j6WPlKW5781pPzjoJ+x/bnGdtGcx uuTBtpVWYP1EIVZayc8v1+tVdlx3U88hJeGR93wdcqabGwMU9X+5WABCuifIa0OxIifc hysCabcrbbeSM9Y6zhoEqmiKxl8WDnMaD8M7zPBe/J8IQaSacfgZT6NdJQNAIRt/Gaa6 ol3w== 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=27GF3PpEkr3PVL2/R3fOM3mHVK6HxUOQY1beGYkX3PQ=; b=sFLSx1+TQhDn4UCUj+KAq/3CD4wdWdGabTrE41mVhGV/cFWpgz1zQj0BpN7TIXuf+8 yhlBsIPswU6TL1B1wjmCwQ5f2d3VPdRpUIxcdXD4PD0WVYN2gxAkfhJqH+hhY8I/J1ny jCASznAM492oo4D5k+WVhWGW9TQgQNAX/vS75St+h8QyzJ9ZE7+v9IJLo+chZP+2OwsO zgqhj77Am89RaHa75yxDVBWtKJ3t+KkreRF/JhZLfhGpZPRC6rbj45fQBQdB84pU8uVs f2z1Rf5Wn7SnoDQEmstGeY5xo94Gv3CaVGgxO1OU9D/2uSfRN+zvh92ihwuTZ6Yqz+ve bVQA== 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 x10-v6si1547149plv.413.2018.10.23.09.22.54; Tue, 23 Oct 2018 09:23:10 -0700 (PDT) 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 S1728402AbeJXAqN (ORCPT + 99 others); Tue, 23 Oct 2018 20:46:13 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:43222 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727730AbeJXAqN (ORCPT ); Tue, 23 Oct 2018 20:46:13 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEzRT-0000jl-GW; Tue, 23 Oct 2018 16:22:03 +0000 Date: Tue, 23 Oct 2018 17:22:03 +0100 From: Al Viro To: Alan Jenkins Cc: David Howells , torvalds@linux-foundation.org, ebiederm@xmission.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, mszeredi@redhat.com Subject: Re: [PATCH 03/34] teach move_mount(2) to work with OPEN_TREE_CLONE [ver #12] Message-ID: <20181023162203.GZ32577@ZenIV.linux.org.uk> References: <153754740781.17872.7869536526927736855.stgit@warthog.procyon.org.uk> <153754743491.17872.12115848333103740766.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 23, 2018 at 12:19:35PM +0100, Alan Jenkins wrote: > I think there's another small hole. It is possible to move a sub-mount from > a detached tree (instead of moving the root of the tree). Then > do_move_mount() calls attach_recursive_mnt() with a non-NULL parent_path. > > This causes it to skip count_mounts(). So, it doesn't count the number of > attached mounts, and it allows you to exceed sysctl_mount_max. That's trivial to repair, fortunately - we just need to check source_mnt->mnt_ns instead of parent_path.