1
0
Fork 0
alistair23-linux/fs/fuse
Miklos Szeredi 732251cabe fuse: fix bad inode
[ Upstream commit 5d069dbe8a ]

Jan Kara's analysis of the syzbot report (edited):

  The reproducer opens a directory on FUSE filesystem, it then attaches
  dnotify mark to the open directory.  After that a fuse_do_getattr() call
  finds that attributes returned by the server are inconsistent, and calls
  make_bad_inode() which, among other things does:

          inode->i_mode = S_IFREG;

  This then confuses dnotify which doesn't tear down its structures
  properly and eventually crashes.

Avoid calling make_bad_inode() on a live inode: switch to a private flag on
the fuse inode.  Also add the test to ops which the bad_inode_ops would
have caught.

This bug goes back to the initial merge of fuse in 2.6.14...

Reported-by: syzbot+f427adf9324b92652ccc@syzkaller.appspotmail.com
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Tested-by: Jan Kara <jack@suse.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-01-09 13:44:54 +01:00
..
Kconfig virtio-fs: add virtiofs filesystem 2019-09-18 20:17:50 +02:00
Makefile virtio-fs: Change module name to virtiofs.ko 2019-10-14 10:20:33 +02:00
acl.c fuse: fix bad inode 2021-01-09 13:44:54 +01:00
control.c convenience helper: get_tree_single() 2019-07-04 22:01:58 -04:00
cuse.c fuse: fix memleak in cuse_channel_open 2019-09-24 15:28:01 +02:00
dev.c fuse: fix page dereference after free 2020-11-01 12:01:05 +01:00
dir.c fuse: fix bad inode 2021-01-09 13:44:54 +01:00
file.c fuse: fix bad inode 2021-01-09 13:44:54 +01:00
fuse_i.h fuse: fix bad inode 2021-01-09 13:44:54 +01:00
inode.c fuse: fix bad inode 2021-01-09 13:44:54 +01:00
readdir.c fuse: fix bad inode 2021-01-09 13:44:54 +01:00
virtio_fs.c virtiofs: schedule blocking async replies in separate worker 2020-06-24 17:50:21 +02:00
xattr.c fuse: fix bad inode 2021-01-09 13:44:54 +01:00