2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 07:34:06 +08:00
linux-next/fs/fuse
Greg Kurz e4a9ccdd1c fuse: Fix infinite loop in sget_fc()
We don't set the SB_BORN flag on submounts. This is wrong as these
superblocks are then considered as partially constructed or dying
in the rest of the code and can break some assumptions.

One such case is when you have a virtiofs filesystem with submounts
and you try to mount it again : virtio_fs_get_tree() tries to obtain
a superblock with sget_fc(). The logic in sget_fc() is to loop until
it has either found an existing matching superblock with SB_BORN set
or to create a brand new one. It is assumed that a superblock without
SB_BORN is transient and the loop is restarted. Forgetting to set
SB_BORN on submounts hence causes sget_fc() to retry forever.

Setting SB_BORN requires special care, i.e. a write barrier for
super_cache_count() which can check SB_BORN without taking any lock.
We should call vfs_get_tree() to deal with that but this requires
to have a proper ->get_tree() implementation for submounts, which
is a bigger piece of work. Go for a simple bug fix in the meatime.

Fixes: bf109c6404 ("fuse: implement crossmounts")
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2021-06-09 15:33:40 +02:00
..
acl.c fuse: add a flag FUSE_SETXATTR_ACL_KILL_SGID to kill SGID 2021-04-14 10:40:57 +02:00
control.c fuse: split fuse_mount off of fuse_conn 2020-09-18 15:17:41 +02:00
cuse.c cuse: simplify refcount 2021-04-14 10:40:58 +02:00
dax.c fuse: split fuse_mount off of fuse_conn 2020-09-18 15:17:41 +02:00
dev.c fuse: fix matching of FUSE_DEV_IOC_CLONE command 2021-04-14 10:40:57 +02:00
dir.c fuse: Fix infinite loop in sget_fc() 2021-06-09 15:33:40 +02:00
file.c fuse update for 5.13 2021-04-30 15:23:16 -07:00
fuse_i.h fuse update for 5.13 2021-04-30 15:23:16 -07:00
inode.c Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2021-05-02 09:14:01 -07:00
ioctl.c fuse: convert to fileattr 2021-04-12 15:04:30 +02:00
Kconfig virtiofs: implement dax read/write operations 2020-09-10 11:39:23 +02:00
Makefile fuse: move ioctl to separate source file 2021-04-12 15:04:30 +02:00
readdir.c new helper: inode_wrong_type() 2021-03-08 10:19:35 -05:00
virtio_fs.c virtiofs: fix userns 2021-04-14 10:40:58 +02:00
xattr.c fuse: extend FUSE_SETXATTR request 2021-04-14 10:40:57 +02:00