lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <58b165011cd8c38ed08d612a2a27af01c74ced95.camel@kernel.org>
Date: Mon, 27 Oct 2025 09:48:15 -0400
From: Jeff Layton <jlayton@...nel.org>
To: Christian Brauner <brauner@...nel.org>, linux-fsdevel@...r.kernel.org, 
 Josef Bacik <josef@...icpanda.com>
Cc: Jann Horn <jannh@...gle.com>, Mike Yuan <me@...dnzj.com>, Zbigniew
 Jędrzejewski-Szmek	 <zbyszek@...waw.pl>, Lennart
 Poettering <mzxreary@...inter.de>, Daan De Meyer	
 <daan.j.demeyer@...il.com>, Aleksa Sarai <cyphar@...har.com>, Amir
 Goldstein	 <amir73il@...il.com>, Tejun Heo <tj@...nel.org>, Johannes Weiner
	 <hannes@...xchg.org>, Thomas Gleixner <tglx@...utronix.de>, Alexander Viro
	 <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>, 
	linux-kernel@...r.kernel.org, cgroups@...r.kernel.org, bpf@...r.kernel.org,
  Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 netdev@...r.kernel.org, Arnd Bergmann	 <arnd@...db.de>
Subject: Re: [PATCH v3 14/70] nstree: allow lookup solely based on inode

On Fri, 2025-10-24 at 12:52 +0200, Christian Brauner wrote:
> The namespace file handle struct nsfs_file_handle is uapi and userspace
> is expressly allowed to generate file handles without going through
> name_to_handle_at().
> 
> Allow userspace to generate a file handle where both the inode number
> and the namespace type are zero and just pass in the unique namespace
> id. The kernel uses the unified namespace tree to find the namespace and
> open the file handle.
> 
> When the kernel creates a file handle via name_to_handle_at() it will
> always fill in the type and the inode number allowing userspace to
> retrieve core information.
> 

Where is the nsfs filehandle format documented? I didn't see any
reference to it in the manpages.

> Signed-off-by: Christian Brauner <brauner@...nel.org>
> ---
>  fs/nsfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nsfs.c b/fs/nsfs.c
> index 8b9bebd11c49..19dc28742a42 100644
> --- a/fs/nsfs.c
> +++ b/fs/nsfs.c
> @@ -502,8 +502,8 @@ static struct dentry *nsfs_fh_to_dentry(struct super_block *sb, struct fid *fh,
>  			return NULL;
>  
>  		VFS_WARN_ON_ONCE(ns->ns_id != fid->ns_id);
> -		VFS_WARN_ON_ONCE(ns->ns_type != fid->ns_type);
> -		VFS_WARN_ON_ONCE(ns->inum != fid->ns_inum);
> +		if (fid->ns_inum && (fid->ns_inum != ns->inum))
> +			return NULL;
>  
>  		/*
>  		 * This is racy because we're not actually taking an

-- 
Jeff Layton <jlayton@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ