Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1204694imj; Sun, 17 Feb 2019 00:05:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IblbfWVD/9NZAdS3Jpn+6xAzyNG01IVxurtNisz8O6WYYXJwI9X9zOGWKq7Pm+ZFhHtsNGW X-Received: by 2002:a63:d413:: with SMTP id a19mr13137237pgh.199.1550390756441; Sun, 17 Feb 2019 00:05:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550390756; cv=none; d=google.com; s=arc-20160816; b=NOGWNWjoPzbu7kd9rJO+8m++FmJSXlYnTqJV2S1aya4pBJUZiFYZx1iQdkY9zqUdBe CJMlTrAI6dz2nbL+RKhZddERLiMCzZ38HZh+eDCITByjqtRAyAm9ihRHm2DHrVBfrfEe yftbVKLHSW+5wZNA2Uk8CphpDlL6PPYIJfp3WQgL+y+jRBQ+9GtH++0K2Dc6OokPwSqk fHnFs8ForXLnPOkRhWpHg3lDyZFDKbczNsDb6vNQVFrEYGzy0jCGkI0PHB7VNQM7x/eP WO3s2ixePzWTjJ/4brtbtudvZnfOqFAY95dIZXWd+p8AbeQBMkFRjK6XMxLMHWv+Vblx rsJQ== 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=nozLm9djqB2mg4728PBbJ4h6z5W3RlBPHIAz1DlJ7KU=; b=OUnMal+KKiAskyBGTzmJEabDnF29PFJpjwX4phPPPw/aQHFp3ombvYUKEP/AsWwjzR 5r+H3xWZpyyA6tMPn/RTsOccwY49iKQHMjChWvFvm23nBFq6qydg2OCA/50wCVi9N4sp dAJHPsjbUFV5aH/sm9OQmBad2C7rI2oQTVeUxtZCUUPEXeCllzxGIrWXvPFt45yHz+Hg wVaLCulCsqEtDM0KpOg2P0krkikeg8udcK4g3JEgaB5SfxrYRQiZEr6nIjvYRmJn0PMn DSDaaNM4D4JYBCGV+/b4J9exUYeaHnT0JBU7zKp+AUhiJdiw7QpTMLGOdNMTCsgDjoTZ gZgQ== 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 q20si10242311pll.255.2019.02.17.00.05.39; Sun, 17 Feb 2019 00:05:56 -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 S1728090AbfBQAL4 (ORCPT + 99 others); Sat, 16 Feb 2019 19:11:56 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:52678 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbfBQALz (ORCPT ); Sat, 16 Feb 2019 19:11:55 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.91 #2 (Red Hat Linux)) id 1gvA3k-0002Ti-E0; Sun, 17 Feb 2019 00:11:52 +0000 Date: Sun, 17 Feb 2019 00:11:52 +0000 From: Al Viro To: David Howells Cc: keyrings@vger.kernel.org, trond.myklebust@hammerspace.com, sfrench@samba.org, linux-security-module@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, rgb@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 08/27] containers, vfs: Honour CONTAINER_NEW_EMPTY_FS_NS Message-ID: <20190217001152.GR2217@ZenIV.linux.org.uk> References: <155024683432.21651.14153938339749694146.stgit@warthog.procyon.org.uk> <155024690964.21651.13823458384398366556.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <155024690964.21651.13823458384398366556.stgit@warthog.procyon.org.uk> 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 Fri, Feb 15, 2019 at 04:08:29PM +0000, David Howells wrote: > + mnt_ns = alloc_mnt_ns(container->cred->user_ns, false); > + if (IS_ERR(mnt_ns)) { > + ret = PTR_ERR(mnt_ns); > + goto out_fd; > + } > + > + mnt = real_mount(path->mnt); > + mnt_add_count(mnt, 1); > + mnt->mnt_ns = mnt_ns; > + mnt_ns->root = mnt; > + mnt_ns->mounts++; > + list_add(&mnt->mnt_list, &mnt_ns->list); > + > + ret = -EBUSY; > + spin_lock(&container->lock); > + if (!container->ns->mnt_ns) { > + container->ns->mnt_ns = mnt_ns; > + write_seqcount_begin(&container->seq); > + container->root.mnt = path->mnt; > + container->root.dentry = path->dentry; > + write_seqcount_end(&container->seq); > + path_get(&container->root); > + mnt_ns = NULL; > + ret = 0; > + } Almost certainly buggered. Assumptions that we _won't_ get to absolute root of namespace (it's overmounted and we are chrooted into it, basically) had been made in quite a few places. The thing you are creating is *not* like normal namespaces in that respect.