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:   Fri, 3 Mar 2023 19:45:04 +0100
From:   Bernd Schubert <bernd.schubert@...tmail.fm>
To:     Alexander Mikhalitsyn <aleksandr.mikhalitsyn@...onical.com>,
        mszeredi@...hat.com
Cc:     Al Viro <viro@...iv.linux.org.uk>,
        Amir Goldstein <amir73il@...il.com>,
        Stéphane Graber <stgraber@...ntu.com>,
        Seth Forshee <sforshee@...nel.org>,
        Christian Brauner <brauner@...nel.org>,
        Andrei Vagin <avagin@...il.com>,
        Pavel Tikhomirov <ptikhomirov@...tuozzo.com>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        criu@...nvz.org
Subject: Re: [RFC PATCH 6/9] fuse: take fuse connection generation into
 account


[...]
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index d5b30faff0b9..be9086a1868d 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -110,7 +110,8 @@ static void fuse_file_put(struct fuse_file *ff, bool sync, bool isdir)
>   	if (refcount_dec_and_test(&ff->count)) {
>   		struct fuse_args *args = &ff->release_args->args;
>   
> -		if (isdir ? ff->fm->fc->flags.no_opendir : ff->fm->fc->flags.no_open) {
> +		if (fuse_stale_ff(ff) ||
> +		    (isdir ? ff->fm->fc->flags.no_opendir : ff->fm->fc->flags.no_open)) {
>   			/* Do nothing when client does not implement 'open' */

The comment does not match anymore.

>   			fuse_release_end(ff->fm, args, 0);
>   		} else if (sync) {
> @@ -597,9 +598,10 @@ static int fuse_fsync(struct file *file, loff_t start, loff_t end,
>   {
>   	struct inode *inode = file->f_mapping->host;
>   	struct fuse_conn *fc = get_fuse_conn(inode);
> +	struct fuse_file *ff = file->private_data;
>   	int err;
>   
> -	if (fuse_is_bad(inode))
> +	if (fuse_stale_ff(ff) || fuse_is_bad(inode))
>   		return -EIO;
>   
>   	inode_lock(inode);
> diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
> index 4f4a6f912c7c..0643de31674d 100644
> --- a/fs/fuse/fuse_i.h
> +++ b/fs/fuse/fuse_i.h
> @@ -954,7 +954,8 @@ static inline bool fuse_stale_inode(const struct inode *inode, int generation,
>   				    struct fuse_attr *attr)
>   {
>   	return inode->i_generation != generation ||
> -		inode_wrong_type(inode, attr->mode);
> +		inode_wrong_type(inode, attr->mode) ||
> +		fuse_stale_inode_conn(inode);
>   }
>   
>   static inline void fuse_make_bad(struct inode *inode)
> diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
> index c3109e016494..f9dc8971274d 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
> @@ -124,7 +124,7 @@ static void fuse_evict_inode(struct inode *inode)
>   			fuse_dax_inode_cleanup(inode);
>   		if (fi->nlookup) {
>   			fuse_queue_forget(fc, fi->forget, fi->nodeid,
> -					  fi->nlookup, false);
> +					  fi->nlookup, fuse_stale_inode_conn(inode));
>   			fi->forget = NULL;
>   		}
>   	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ