On Mon, Feb 5, 2024 at 3:52 PM Miklos Szeredi <[email protected]> wrote:
>
> On Mon, 5 Feb 2024 at 13:31, Christian Brauner <[email protected]> wrote:
> >
> > On Sun, Feb 04, 2024 at 02:17:37AM +0000, Al Viro wrote:
> > > ->permission(), ->get_link() and ->inode_get_acl() might dereference
> > > ->s_fs_info (and, in case of ->permission(), ->s_fs_info->fc->user_ns
> > > as well) when called from rcu pathwalk.
> > >
> > > Freeing ->s_fs_info->fc is rcu-delayed; we need to make freeing ->s_fs_info
> > > and dropping ->user_ns rcu-delayed too.
> > >
> > > Signed-off-by: Al Viro <[email protected]>
> > > ---
> >
> > Reviewed-by: Christian Brauner <[email protected]>
>
> Acked-by: Miklos Szeredi <[email protected]>
>
Miklos,
FYI, this is now merged and conflicts with:
dc076c73b9f9 ("fuse: implement ioctls to manage backing files")
from fuse/for-next:
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@@ -1373,7 -1398,9 +1405,13 @@@ EXPORT_SYMBOL_GPL(fuse_send_init)
void fuse_free_conn(struct fuse_conn *fc)
{
WARN_ON(!list_empty(&fc->devices));
++<<<<<<< HEAD
+ kfree(fc);
++=======
+ if (IS_ENABLED(CONFIG_FUSE_PASSTHROUGH))
+ fuse_backing_files_free(fc);
+ kfree_rcu(fc, rcu);
++>>>>>>> fuse/for-next
}
EXPORT_SYMBOL_GPL(fuse_free_conn);
Note that fuse_backing_files_free() calls
fuse_backing_id_free() => fuse_backing_free() => kfree_rcu()
Should we move fuse_backing_files_free() into
fuse_conn_put() above fuse_dax_conn_free()?
That will avoid the merge conflict and still be correct. no?
Thanks,
Amir.