Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp45505pxb; Tue, 12 Jan 2021 19:34:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwLqZNNnN3cP4WykdCJwibkImO7e0n18vW4tf9GKFiQkKTG+97Z+yjiiRNC1vkLN0ETI7p X-Received: by 2002:a17:906:4717:: with SMTP id y23mr97676ejq.6.1610508841500; Tue, 12 Jan 2021 19:34:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610508841; cv=none; d=google.com; s=arc-20160816; b=xrvodDITVkgvRIVR68eTtLXEXemDUP64mNmVsj1mynuu2oRc7+J33tK/RtIysVoaua /Y3/dNW1UlEVyGTZ3PXG3SPmyFzKzfBvHr8Bemwvy3iS3EaCtS4DR1zzHu8m/Sh3wyKI zVKOa4NiBAlPCoU8D6aWkYpaRjPBHmyFytbfSdpeK9Z+oLha8WHtDCjSY7BqPtYxn4vt fRh+u8/fVwEiFhYWL/gXqVfNttDrJRPFU4afktnR+4JD9GbaEX7tM3xGXQjtBOibO2lr rpEJqtor07H6KtFA11lLVFN+y5PlYu7bupw9f06ItFEzzrjFBCnWyUScm694cSNKoF8d s0qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=I9mSrNXmHFYMPApxgFQbDM45P8v8X64ckBsmGZBNtcc=; b=ndFznjBFG1R50FB+seoWBkw+mQPwqBsV2M5/erIfhR7MoGqm7N4OfHt9yAqEJfucXf xMSVe3UdOSduVnZr7BC/ZopcgVPJBopfOsDL2nHME10G3MyEqA8sSJtPfji+7XFQPhAk 7PKMheZIHj7qsozsX/M2PWwTgaNGB/eYtAuXxpS3bEvipozB1/t3coMVSDgrveni2k56 UV+gw6kukSzK2kEOzhgzIT/JwLxFq9tGCRAWv76E8XACGYgm2OXQy7bepoe2F6eCGpC4 QMtFk5GaVRbyif/pUFyu822mXamaj22IX1tnY3R4Gps0UiyXB3rKfyuSpq93HwliqlGU A/GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=u46K90hk; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si387098edo.323.2021.01.12.19.33.37; Tue, 12 Jan 2021 19:34:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=u46K90hk; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392415AbhAMAnQ (ORCPT + 99 others); Tue, 12 Jan 2021 19:43:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392449AbhAMAeK (ORCPT ); Tue, 12 Jan 2021 19:34:10 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24FCAC0617AA; Tue, 12 Jan 2021 16:33:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=I9mSrNXmHFYMPApxgFQbDM45P8v8X64ckBsmGZBNtcc=; b=u46K90hkeHO3rgVFT8nIkAgzOu URjQXngiZDy+HRu2wxUeRCxaK99ieki5JPU6LEoLpjhkVt8RQaLmgBoK0NLhGruy0JFl5qwVZ9cPS SBniw1n3CBJVYJBUDWfaeMzEtZSYDwOFRVc7C9nhxeLaPFQjoJu2oIJ7p6N9bT8/PtXvBzktQxxnd lRIYvTygjTQRLIo9G3UJCdSTY71pssx/RAVQAZanXGgnbufK9U6wyvZ9UVYX99gwEq42DMQDLHimz u/83ju95Eitc0mOBWxZ9GyeE9wzkY074t/cE1JnWyD2WdLBsAqlep2idC+WvMkdxzcr/OJOiGlAaG 4EiP6yjQ==; Received: from [2601:1c0:6280:3f0::9abc] by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzU5g-0006Zu-CI; Wed, 13 Jan 2021 00:32:48 +0000 Subject: Re: [PATCH v5 41/42] tests: extend mount_setattr tests To: Christian Brauner , Alexander Viro , Christoph Hellwig , linux-fsdevel@vger.kernel.org Cc: John Johansen , James Morris , Mimi Zohar , Dmitry Kasatkin , Stephen Smalley , Casey Schaufler , Arnd Bergmann , Andreas Dilger , OGAWA Hirofumi , Geoffrey Thomas , Mrunal Patel , Josh Triplett , Andy Lutomirski , Theodore Tso , Alban Crequy , Tycho Andersen , David Howells , James Bottomley , Seth Forshee , =?UTF-8?Q?St=c3=a9phane_Graber?= , Linus Torvalds , Aleksa Sarai , Lennart Poettering , "Eric W. Biederman" , smbarber@chromium.org, Phil Estes , Serge Hallyn , Kees Cook , Todd Kjos , Paul Moore , Jonathan Corbet , containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-integrity@vger.kernel.org, selinux@vger.kernel.org, Christoph Hellwig References: <20210112220124.837960-1-christian.brauner@ubuntu.com> <20210112220124.837960-42-christian.brauner@ubuntu.com> From: Randy Dunlap Message-ID: <5060dcc4-09a3-0ccc-6080-aab3f6b9caef@infradead.org> Date: Tue, 12 Jan 2021 16:32:32 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20210112220124.837960-42-christian.brauner@ubuntu.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi, On 1/12/21 2:01 PM, Christian Brauner wrote: > --- > /* v2 */ > patch introduced > > /* v3 */ > - Christoph Hellwig , Darrick J. Wong : > - Port main test-suite to xfstests. > > /* v4 */ > unchanged > > /* v5 */ > base-commit: 7c53f6b671f4aba70ff15e1b05148b10d58c2837 > --- > .../mount_setattr/mount_setattr_test.c | 483 ++++++++++++++++++ > 1 file changed, 483 insertions(+) > > diff --git a/tools/testing/selftests/mount_setattr/mount_setattr_test.c b/tools/testing/selftests/mount_setattr/mount_setattr_test.c > index 447b91c05cbd..4e94e566e040 100644 > --- a/tools/testing/selftests/mount_setattr/mount_setattr_test.c > +++ b/tools/testing/selftests/mount_setattr/mount_setattr_test.c > @@ -108,15 +108,57 @@ struct mount_attr { > __u64 attr_set; > __u64 attr_clr; > __u64 propagation; > + __u64 userns_fd; > }; > #endif ... Does "/**" have any special meaning inside tools/testing/ and the selftest framework? (I don't see any other such users.) If not, can you just use the usual "/*" instead? (multiple locations) > +/** > + * Validate that negative fd values are rejected. > + */ > +TEST_F(mount_setattr_idmapped, invalid_fd_negative) > +{ ... > +} > + > +/** > + * Validate that excessively large fd values are rejected. > + */ > +TEST_F(mount_setattr_idmapped, invalid_fd_large) > +{ ... > +} > + > +/** > + * Validate that closed fd values are rejected. > + */ > +TEST_F(mount_setattr_idmapped, invalid_fd_closed) > +{ ... > + } > +} > + > +/** > + * Validate that the initial user namespace is rejected. > + */ > +TEST_F(mount_setattr_idmapped, invalid_fd_initial_userns) > +{ ... > +/** > + * Validate that an attached mount in our mount namespace can be idmapped. > + * (The kernel enforces that the mount's mount namespace and the caller's mount > + * namespace match.) > + */ > +TEST_F(mount_setattr_idmapped, attached_mount_inside_current_mount_namespace) > +{ > +} > + > +/** > + * Validate that idmapping a mount is rejected if the mount's mount namespace > + * and our mount namespace don't match. > + * (The kernel enforces that the mount's mount namespace and the caller's mount > + * namespace match.) > + */ > +TEST_F(mount_setattr_idmapped, attached_mount_outside_current_mount_namespace) > +{ ... > +} > + > +/** > + * Validate that an attached mount in our mount namespace can be idmapped. > + */ > +TEST_F(mount_setattr_idmapped, detached_mount_inside_current_mount_namespace) > +{ ... > +} > + > +/** > + * Validate that a detached mount not in our mount namespace can be idmapped. > + */ > +TEST_F(mount_setattr_idmapped, detached_mount_outside_current_mount_namespace) > +{ ... > +} > + > +/** > + * Validate that currently changing the idmapping of an idmapped mount fails. > + */ > +TEST_F(mount_setattr_idmapped, change_idmapping) > +{ thanks. -- ~Randy You can't do anything without having to do something else first. -- Belefant's Law