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:47:26 +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 4/9] fuse: handle stale inode connection in
 fuse_queue_forget



On 2/20/23 20:37, Alexander Mikhalitsyn wrote:
> We don't want to send FUSE_FORGET request to the new
> fuse daemon if inode was lookuped by the old fuse daemon
> because it can confuse and break userspace (libfuse).
> 
> For now, just add a new argument to fuse_queue_forget and
> handle it. Adjust all callers to match the old behaviour.
> 
> Cc: Miklos Szeredi <mszeredi@...hat.com>
> Cc: Al Viro <viro@...iv.linux.org.uk>
> Cc: Amir Goldstein <amir73il@...il.com>
> Cc: Stéphane Graber <stgraber@...ntu.com>
> Cc: Seth Forshee <sforshee@...nel.org>
> Cc: Christian Brauner <brauner@...nel.org>
> Cc: Andrei Vagin <avagin@...il.com>
> Cc: Pavel Tikhomirov <ptikhomirov@...tuozzo.com>
> Cc: linux-fsdevel@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
> Cc: criu@...nvz.org
> Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@...onical.com>
> ---
>   fs/fuse/dev.c    | 4 ++--
>   fs/fuse/dir.c    | 8 ++++----
>   fs/fuse/fuse_i.h | 2 +-
>   fs/fuse/inode.c  | 2 +-
>   4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> index eb4f88e3dc97..85f69629f34d 100644
> --- a/fs/fuse/dev.c
> +++ b/fs/fuse/dev.c
> @@ -234,7 +234,7 @@ __releases(fiq->lock)
>   }
>   
>   void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget,
> -		       u64 nodeid, u64 nlookup)
> +		       u64 nodeid, u64 nlookup, bool stale_inode_conn)
>   {
>   	struct fuse_iqueue *fiq = &fc->iq;
>   
> @@ -242,7 +242,7 @@ void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget,
>   	forget->forget_one.nlookup = nlookup;
>   
>   	spin_lock(&fiq->lock);
> -	if (fiq->connected) {
> +	if (fiq->connected && !stale_inode_conn) {
>   		fiq->forget_list_tail->next = forget;
>   		fiq->forget_list_tail = forget;
>   		fiq->ops->wake_forget_and_unlock(fiq);

I'm not sure about kernel coding rules here - for me that is unlikely 
rare event - I would have added unlikely() here.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ