Received: by 2002:a05:7412:85a1:b0:e2:908c:2ebd with SMTP id n33csp167475rdh; Mon, 30 Oct 2023 18:24:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/iNpn7Y40njKjdznBhkSBZhXU+3Nn7f8j5uICtFxq0YA6T0h9CFgbMvqVkGFjm9rPH0Hx X-Received: by 2002:a17:90a:4f48:b0:27d:166b:40f6 with SMTP id w8-20020a17090a4f4800b0027d166b40f6mr8242445pjl.41.1698715463188; Mon, 30 Oct 2023 18:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698715463; cv=none; d=google.com; s=arc-20160816; b=miJb8oHC/ISxuM+kh55aeJDOL2f3XZRUpszVBNOncTsxApyXyTPTtgxahkQ0AN556h Lo7wDcTxOe80iRijakHX1vbjrQclEoMtFjarGZ9tw8kHeJQR8HoGD9CZa/18x2bC9Wp9 +dAMYcfFDngkegO6vhUHO3Rp7PvP9xnLQHuOX9kvJlL3GmmLlpjAelgCq7rPwyRXAOC6 FMVDIMtd47wWazOGI8xqe+aIaepPW5U3K+UJywxGIfh/AoXH97GNMrD6zE05h//ZHlyv 4t28kzDSJK7Ne6hAhJX4N/0zLn9DMVIwjyudakbbjFXLXTLeM7vm9IWuS0EqsPm8/DcI mLYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=ECJVLlwFCF/F13QtKPM5WP7/K4iiTwcNU6h5mUohoTo=; fh=0aClYxBEUJjF5QzWPOIwz0LsBVX1cvMGrZ1POdvkB/o=; b=nJEyQOZNIdwwnuq68VGd4rYqfPyP130JR6dkCGJyTE5Ca2tt1tnzUQAr8eh4CIPA9b /+0IieLZscOBHV0r5pLVr5Vxy1NDw1Z2mPg8mm8WXWfGzREz9KvApwPl9u/qkGdzQZKD n1y6hqVP2Vx3rpyX2VACu/H40vBJRDUw7eSEobhb+/Wi01acFTV7bS1Jm+Hjdir69mJs cO+M9R/CNkcIdvwJQ4H2G/fyNHOiJxjW83Hr+nW2xMRdq1hzlvTz1P6NTvtuiGuqB4lE vR0lCT8/c3h8qNNmo9olPqIRUZ27OIEUUfonh1iM4pGHKu8aSxF5bY60lNNUU2nb9aJj 5hcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@themaw.net header.s=fm2 header.b=nhepGC7V; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=V8vq+xXi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ft13-20020a17090b0f8d00b002802c4518d1si175780pjb.148.2023.10.30.18.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 18:24:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@themaw.net header.s=fm2 header.b=nhepGC7V; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=V8vq+xXi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id CBA1280AC5A1; Mon, 30 Oct 2023 18:23:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231232AbjJaBXu (ORCPT + 99 others); Mon, 30 Oct 2023 21:23:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjJaBXt (ORCPT ); Mon, 30 Oct 2023 21:23:49 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F22C1; Mon, 30 Oct 2023 18:23:46 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 8DFAB5C02B7; Mon, 30 Oct 2023 21:23:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 30 Oct 2023 21:23:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=themaw.net; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1698715424; x=1698801824; bh=ECJVLlwFCF/F13QtKPM5WP7/K4iiTwcNU6h 5mUohoTo=; b=nhepGC7V5AVwfIUrdbvCdHNrqipLAurfvLbQehLFlJ53PiUjGoZ YQNs45CB7LtqeuVosRrGDSCuNaN0knFyLHWoleezyEpj6oloWy1y5T8EzTMn6wib qgRnbta7rHMoy6m2/X/nmzMo9p7hgeZL/CyqTvzZLRYo08N/IYYZBHv34K4ZEDiM 8F0SAyY4pTpoweMqbam8L6MaDOFST2SHTpkK2SyA7tjPSAtVu0Th86zROcl/daSv ZaHowa3QE+DWxnLYTZxxPuExD2IDfLP4EkxVLOFwlZmw/CERmalaW+PssNvFlqyh Vf0zb0jlh87nSrFAEnyfYZbG0spHqcDbqPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698715424; x=1698801824; bh=ECJVLlwFCF/F13QtKPM5WP7/K4iiTwcNU6h 5mUohoTo=; b=V8vq+xXih7rt9zzoQ8UjyrZgqbTJ3TvTAvP874IAxlU1ZKueUtG 9rbs1eKo1yjw0lpwbgLt1duEkvmUkBEXFzytHMf6+add0oa6AIGM54KmG8ghAUjW wT5BCE2sTlUGsZ/xjujq3pzW8sNzTH3g+RE77BA+KeDTnakzcIb0TLiC02ppEb6R Fpt1fTHiuGTI6fzluPvumknJRDzLCMcooAHnrHXeUtgLJZ/hel1/HGECO+m8i7Xf bPwv4NJnSkmopsngxXmfUSZSSftmxvTDJsazZhukrALWo0AqKRoCHxj/dz6IxAoG eD+h1q7A1dmGBYdgnl256NOMTlb15CG87gQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtuddgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefkrghn ucfmvghnthcuoehrrghvvghnsehthhgvmhgrfidrnhgvtheqnecuggftrfgrthhtvghrnh epgedvteevvdefiedvueeujeegtedvheelhfehtefhkefgjeeuffeguefgkeduhfejnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhgrvhgvnh esthhhvghmrgifrdhnvght X-ME-Proxy: Feedback-ID: i31e841b0:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Oct 2023 21:23:38 -0400 (EDT) Message-ID: Date: Tue, 31 Oct 2023 09:23:34 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v4 2/6] mounts: keep list of mounts in an rbtree To: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org, linux-security-module@vger.kernel.org, Karel Zak , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein , Matthew House , Florian Weimer , Arnd Bergmann References: <20231025140205.3586473-1-mszeredi@redhat.com> <20231025140205.3586473-3-mszeredi@redhat.com> Content-Language: en-US From: Ian Kent In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 30 Oct 2023 18:23:57 -0700 (PDT) On 30/10/23 17:06, Miklos Szeredi wrote: > On Mon, Oct 30, 2023 at 6:45 AM Ian Kent wrote: > >> Is fs/namespace.c:iterate_mounts() a problem? >> >> It's called from: >> >> 1) ./kernel/audit_tree.c:709: if (iterate_mounts(compare_root, >> 2) ./kernel/audit_tree.c:839: err = iterate_mounts(tag_mount, tree, mnt); >> 3) ./kernel/audit_tree.c:917: failed = iterate_mounts(tag_mount, >> tree, tagged); >> >> >> From functions 1) audit_trim_trees(), 2) audit_add_tree_rule() and >> >> 3) audit_tag_tree(). > So that interface works like this: > > - collect_mounts() creates a temporary copy of a mount tree, mounts > are chained on mnt_list. Right, sorry for the noise, I didn't look far enough. Ian > > - iterate_mounts() is used to do some work on the temporary tree > > - drop_collected_mounts() frees the temporary tree > > These mounts are never installed in a namespace. My guess is that a > private copy is used instead of the original mount tree to prevent > races. > > Thanks, > Miklos >