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: <aQo5_P5XCsSZhw7N@horms.kernel.org>
Date: Tue, 4 Nov 2025 17:38:04 +0000
From: Simon Horman <horms@...nel.org>
To: Jeff Layton <jlayton@...nel.org>
Cc: Miklos Szeredi <miklos@...redi.hu>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
	Chuck Lever <chuck.lever@...cle.com>,
	Alexander Aring <alex.aring@...il.com>,
	Trond Myklebust <trondmy@...nel.org>,
	Anna Schumaker <anna@...nel.org>, Steve French <sfrench@...ba.org>,
	Paulo Alcantara <pc@...guebit.org>,
	Ronnie Sahlberg <ronniesahlberg@...il.com>,
	Shyam Prasad N <sprasad@...rosoft.com>, Tom Talpey <tom@...pey.com>,
	Bharath SM <bharathsm@...rosoft.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Danilo Krummrich <dakr@...nel.org>,
	David Howells <dhowells@...hat.com>, Tyler Hicks <code@...icks.com>,
	NeilBrown <neil@...wn.name>,
	Olga Kornievskaia <okorniev@...hat.com>,
	Dai Ngo <Dai.Ngo@...cle.com>, Amir Goldstein <amir73il@...il.com>,
	Namjae Jeon <linkinjeon@...nel.org>,
	Steve French <smfrench@...il.com>,
	Sergey Senozhatsky <senozhatsky@...omium.org>,
	Carlos Maiolino <cem@...nel.org>,
	Kuniyuki Iwashima <kuniyu@...gle.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-nfs@...r.kernel.org, linux-cifs@...r.kernel.org,
	samba-technical@...ts.samba.org, netfs@...ts.linux.dev,
	ecryptfs@...r.kernel.org, linux-unionfs@...r.kernel.org,
	linux-xfs@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v4 10/17] vfs: make vfs_create break delegations on
 parent directory

On Mon, Nov 03, 2025 at 07:52:38AM -0500, Jeff Layton wrote:
> In order to add directory delegation support, we need to break
> delegations on the parent whenever there is going to be a change in the
> directory.
> 
> Add a delegated_inode parameter to struct createdata. Most callers just
> leave that as a NULL pointer, but do_mknodat() is changed to wait for a
> delegation break if there is one.
> 
> Signed-off-by: Jeff Layton <jlayton@...nel.org>
> ---
>  fs/namei.c         | 26 +++++++++++++++++---------
>  include/linux/fs.h |  2 +-
>  2 files changed, 18 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/namei.c b/fs/namei.c

...

> @@ -4359,6 +4362,8 @@ static int may_mknod(umode_t mode)
>  static int do_mknodat(int dfd, struct filename *name, umode_t mode,
>  		unsigned int dev)
>  {
> +	struct delegated_inode delegated_inode = { };
> +	struct createdata cargs = { };
>  	struct mnt_idmap *idmap;
>  	struct dentry *dentry;
>  	struct path path;
> @@ -4383,18 +4388,16 @@ static int do_mknodat(int dfd, struct filename *name, umode_t mode,
>  	switch (mode & S_IFMT) {
>  		case 0:
>  		case S_IFREG:
> -		{
> -			struct createdata args = { .idmap = idmap,
> -						   .dir = path.dentry->d_inode,
> -						   .dentry = dentry,
> -						   .mode = mode,
> -						   .excl = true };
> -
> -			error = vfs_create(&args);
> +			cargs.idmap = idmap,
> +			cargs.dir = path.dentry->d_inode,
> +			cargs.dentry = dentry,
> +			cargs.delegated_inode = &delegated_inode;
> +			cargs.mode = mode,
> +			cargs.excl = true,

Hi Jeff,

I don't think it makes any difference to the generated code.
But I think it would be more intuitive to use ';' rather than ','
at the end of the lines immediately above.

> +			error = vfs_create(&cargs);
>  			if (!error)
>  				security_path_post_mknod(idmap, dentry);
>  			break;
> -		}
>  		case S_IFCHR: case S_IFBLK:
>  			error = vfs_mknod(idmap, path.dentry->d_inode,
>  					  dentry, mode, new_decode_dev(dev));

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ