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]
Date: Sun, 17 Mar 2024 08:23:28 -0400
From: Jeff Layton <jlayton@...nel.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>, Chuck
 Lever <chuck.lever@...cle.com>, Alexander Aring <alex.aring@...il.com>,
 Trond Myklebust <trond.myklebust@...merspace.com>, Anna Schumaker
 <anna@...nel.org>, Steve French <sfrench@...ba.org>, Paulo Alcantara
 <pc@...guebit.com>, Ronnie Sahlberg <ronniesahlberg@...il.com>, Shyam
 Prasad N <sprasad@...rosoft.com>, Tom Talpey <tom@...pey.com>, Greg
 Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki"
 <rafael@...nel.org>, David Howells <dhowells@...hat.com>, Tyler Hicks
 <code@...icks.com>,  Neil Brown <neilb@...e.de>, Olga Kornievskaia
 <kolga@...app.com>, Dai Ngo <Dai.Ngo@...cle.com>, Miklos Szeredi
 <miklos@...redi.hu>, Amir Goldstein <amir73il@...il.com>, Namjae Jeon
 <linkinjeon@...nel.org>, Sergey Senozhatsky <senozhatsky@...omium.org>, 
 "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, netdev@...r.kernel.org
Subject: Re: [PATCH RFC 06/24] vfs: break parent dir delegations in
 open(..., O_CREAT) codepath

On Sun, 2024-03-17 at 00:19 +0000, Al Viro wrote:
> On Fri, Mar 15, 2024 at 12:52:57PM -0400, 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 lookup_open and have it break the
> > delegation. Then, open_last_lookups can wait for the delegation break
> > and retry the call to lookup_open once it's done.
> 
> > @@ -3490,6 +3490,11 @@ static struct dentry *lookup_open(struct nameidata *nd, struct file *file,
> 
> Wait a sec - are you going to do anything to the atomic_open side of things?
> 
> 

Hmm good point. I was thinking that all of the filesystems that had
atomic_open didn't support leases. I'm wrong though -- there are some
that currently do:

9p: It's a network filesystem, and I don't think it has any sort of
asynchronous notification or delegation-like object, does it? It might
be best though to just make it call simple_nosetlease.

fuse: fuse allows leases today. I doubt we can get away with turning
that off now. There probably ought to be a way for the userland driver
to opt-in or out of allowing built-in lease support maybe a flag or
something?

ntfs3: IDGI. Why does ntfs3 (which is a local filesystem, unless I'm
mistaken) have an atomic_open? Shouldn't lookup+open be fine, like with
most local filesystems?

vboxsf: Probably the same situation as 9p. Can we just disable leases?

I'll spin up a patchset soon to add proper setlease handlers to all of
the above. Then we can then guard against allowing generic_setlease on
filesystems by default on filesystems with an atomic_open handler.

Another (maybe better) idea might be to require filesystems to specify a
setlease handler if they want them enabled. We could just set the
existing local filesystems to generic_setlease. That would make lease
support a strictly opt-in thing, which is probably the best idea for
avoiding surprises with them.

>  
> >  	/* Negative dentry, just create the file */
> >  	if (!dentry->d_inode && (open_flag & O_CREAT)) {
> > +		/* but break the directory lease first! */
> > +		error = try_break_deleg(dir_inode, delegated_inode);
> > +		if (error)
> > +			goto out_dput;

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ