1
0
Fork 0
remarkable-linux/fs/fuse
Miklos Szeredi 69829f749a fuse: fix control dir setup and teardown
commit 6becdb601b upstream.

syzbot is reporting NULL pointer dereference at fuse_ctl_remove_conn() [1].
Since fc->ctl_ndents is incremented by fuse_ctl_add_conn() when new_inode()
failed, fuse_ctl_remove_conn() reaches an inode-less dentry and tries to
clear d_inode(dentry)->i_private field.

Fix by only adding the dentry to the array after being fully set up.

When tearing down the control directory, do d_invalidate() on it to get rid
of any mounts that might have been added.

[1] https://syzkaller.appspot.com/bug?id=f396d863067238959c91c0b7cfc10b163638cac6
Reported-by: syzbot <syzbot+32c236387d66c4516827@syzkaller.appspotmail.com>
Fixes: bafa96541b ("[PATCH] fuse: add control filesystem")
Cc: <stable@vger.kernel.org> # v2.6.18
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-03 11:24:49 +02:00
..
Kconfig fuse: Add posix ACL support 2016-10-01 07:32:32 +02:00
Makefile fuse: Use generic xattr ops 2016-10-01 07:32:32 +02:00
acl.c fuse: Add posix ACL support 2016-10-01 07:32:32 +02:00
control.c fuse: fix control dir setup and teardown 2018-07-03 11:24:49 +02:00
cuse.c fuse: honor iocb sync flags on write 2017-09-12 16:57:53 +02:00
dev.c fuse: fix congested state leak on aborted connections 2018-07-03 11:24:49 +02:00
dir.c fuse: atomic_o_trunc should truncate pagecache 2018-07-03 11:24:49 +02:00
file.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse 2017-09-13 10:10:19 -07:00
fuse_i.h fuse: getattr cleanup 2017-09-12 16:57:54 +02:00
inode.c fuse: don't keep dead fuse_conn at fuse_fill_super(). 2018-07-03 11:24:49 +02:00
xattr.c fuse: limit xattr returned size 2016-10-03 11:06:05 +02:00