Skip to content
Commit 6becdb60 authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

fuse: fix control dir setup and teardown

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: default avatarsyzbot <syzbot+32c236387d66c4516827@syzkaller.appspotmail.com>
Fixes: bafa9654 ("[PATCH] fuse: add control filesystem")
Cc: <stable@vger.kernel.org> # v2.6.18
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 8a301eb1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment