From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796442416; b=ga1mggHa+VVdj4a0ukqqhbTBnn9wTKNcXGxcSV2bV/MJd6O0UWT6CeSZcl/tlA2fCUIr WNUR31Ld7Qy0dYcUIb6EZfFIqrfbMdvNnOkJNjV4oki4FjfP4MhzCabjLq5FYtx3pj1cE zI2oAw5ltT277VBoeoDwQAQgDgCk1KiiJ5/peG7sgodLd4kV5FR+Hc0Ix7V9+ZAm/htHM DwbEVcNMv4bx4zhWO/0V2/Jl3XtbgwGvjMblIc4SNWAg8alTFWen6p4J9eQbbuLefQW3Q iYe4Tyj1vzhYFtmEV24mNP8CZUBMk5aTSBH6vfpgVa8TMk9Hh5i3p0qLm6VBqwNbDPQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796442416; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=DZlVf9oMtDiOXiD/gXCBRXgTqFa/2jAXyscg0ZPn/ik=; b=kNosd3fWxd8/GRKuAU5PzxQ8TEQ/oPC1x1DCAIgnka6GOQKNiYtZl4rG+KX/5lnJ11tn mF8RergiUxYuk+c0+cqivmVzPfep9/wOIyPj+NnYPyJJnT8gdIQzoW5q60/wm4m0NuSWP WvtTV+8MQaRs0FqJNU60EXF8mYa7BAu6ZanCil9lpOpqQglw2BNngxXoPRWtiXExKKrfF dQhX3LgZsTMSOl5o+vs3zadxL73Ea6jsPrTwsSZm6URCaH7mucCfImTdfCy3QQVBc7SmG OUpxfqC4yIwkbrl2Vp0vkzBjWU4K8gXc5E8uIS/kc5i5JisUfpXKUWugr15nC4jtVTA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q2ayQ8wW; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37DDB606A322; Sat, 5 Dec 2026 03:46:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q2ayQ8wW Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78F411F0092B; Sat, 5 Dec 2026 03:46:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796442415; bh=DZlVf9oMtDiOXiD/gXCBRXgTqFa/2jAXyscg0ZPn/ik=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Q2ayQ8wWh58+tlSLNksRRXFfhO81nwS6hRgPMd1WarLwPn8LVeAFP17zDEbCzxOIx Y6mBq2WA4UY+eVB/mDfusuCKvU4LsPhIFCHKCrr7TzqmYC1C4uegsz9hWcq/RwM71d pSH1f+Y3DsuPpVP0VRX/D+XzzZJBhZXK6+bpqPcBUynHyOVVND21IRv17+ubrHAQZQ YzJ68Ib2ja5HDxygFY2qmXyrj4uuqGFemqpjZclHbxAERPmKCXhrUdt1v2rKMbvmku ccbtA1uTnxf2fv8yueiRAAEk/2FRoZXehclT6egO6UWA+WcDuaf+rdO5ZT15vX/Akr WHxaP98TbHLCQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH v10 03/28] mount: Add mnt_ns_get_root() Reply-To: sashiko-reviews@lists.linux.dev To: "Jarkko Sakkinen" Cc: bpf@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, "Aleksa Sarai" , "Alexander Mikhalitsyn" , "Alexander Viro" , "Alexei Starovoitov" , "Andrew Morton" , "Andrii Nakryiko" , "Andy Lutomirski" , "Arnd Bergmann" , "Baolin Wang" , "Ben Segall" , "Christian Brauner" , "Daniel Borkmann" , "David Hildenbrand" , "David Howells" , "David Woodhouse" , "Davidlohr Bueso" , "Dietmar Eggemann" , "Eduard Zingerman" , "Emil Tsalapatis" , "Eric Biggers" , "Georgia Garcia" , "Giuseppe Scrivano" , =?utf-8?b?R8O8bnRoZXIgTm9hY2s=?= , "Hugh Dickins" , "Ihor Solodrai" , "Ingo Molnar" , "James Morris" , "Jan Kara" , "Jason Gunthorpe" , "Jeff Layton" , "Jiri Olsa" , "John Johansen" , "Jonathan Corbet" , "Josef Bacik" , "Juri Lelli" , "Kees Cook" , "K Prateek Nayak" , "KP Singh" , "Kumar Kartikeya Dwivedi" , "Lennart Poettering" , "Liam R. Howlett" , "Manfred Spraul" , "Martin KaFai Lau" , "Matt Bobrowski" , "Mel Gorman" , "Michal Hocko" , =?utf-8?b?TWlja2HDq2wgU2FsYcO8bg==?= , "Mike Rapoport" , "Neal Gompa" , "Oleg Nesterov" , "Paul Moore" , "Pavel Tikhomirov" , "Peter Zijlstra" , "Randy Dunlap" , "Serge E. Hallyn" , "Serge Hallyn" , "Shuah Khan" , "Song Liu" , "Stephen Smalley" , "Steven Rostedt" , "Valentin Schneider" , "Vincent Guittot" , "Yonghong Song" , "Zygmunt Krynicki" In-Reply-To: <20261205032633.1702772-4-jarkko@kernel.org> References: <20261205032633.1702772-1-jarkko@kernel.org> <20261205032633.1702772-4-jarkko@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 03:46:53 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] mount: missing API contract documentation for mnt_ns_get_root() -- commit 6f336bfd8a54d1c830f04491f0b986e5e814490e Author: Jarkko Sakkinen mount: Add mnt_ns_get_root() This commit adds mnt_ns_get_root() and declares it in include/linux/mnt_namespace.h to resolve the live root path of a mount namespace, returning -ENOENT if no filesystem is mounted over the initial root. > diff --git a/fs/namespace.c b/fs/namespace.c > index aecd05ac01705..781380945d784 100644 > --- a/fs/namespace.c > +++ b/fs/namespace.c > @@ -6708,6 +6708,22 @@ static void mntns_put(struct ns_common *ns) > put_mnt_ns(to_mnt_ns(ns)); > } > =20 > +int mnt_ns_get_root(struct mnt_namespace *mnt_ns, struct path *root) > +{ > + int err; > + > + err =3D vfs_path_lookup(mnt_ns->root->mnt.mnt_root, &mnt_ns->root->mnt, > + "/", LOOKUP_DOWN, root); > + if (err) > + return err; > + if (root->mnt =3D=3D &mnt_ns->root->mnt) { > + path_put(root); > + *root =3D (struct path){}; > + return -ENOENT; > + } > + return 0; > +} [Severity: Low] Since mnt_ns_get_root() is exposed as a cross-subsystem helper in include/linux/mnt_namespace.h, should it have a kernel-doc comment documenting its preconditions and ownership rules? Callers must hold an active reference to a non-anonymous mount namespace, since mnt_ns->root is dereferenced without namespace_sem and anonymous namespaces do not use a nullfs base root. Because it calls vfs_path_lookup() and path_put(), it requires sleepable context without mount_lock or namespace_sem held. On success, the caller must release *root with path_put(); on -ENOENT *root is zeroed, while on other lookup errors it is left untouched. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205032633.1702= 772-1-jarkko@kernel.org?part=3D3