Skip to content
Commit 80019f11 authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

fuse: always initialize sb->s_fs_info



Syzkaller reports a null pointer dereference in fuse_test_super() that is
caused by sb->s_fs_info being NULL.

This is due to the fact that fuse_fill_super() is initializing s_fs_info,
which is too late, it's already on the fs_supers list.  The initialization
needs to be done in sget_fc() with the sb_lock held.

Move allocation of fuse_mount and fuse_conn from fuse_fill_super() into
fuse_get_tree().

After this ->kill_sb() will always be called with non-NULL ->s_fs_info,
hence fuse_mount_destroy() can drop the test for non-NULL "fm".

Reported-by: default avatar <syzbot+74a15f02ccb51f398601@syzkaller.appspotmail.com>
Fixes: 5d5b74aa

 ("fuse: allow sharing existing sb")
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent c191cd07
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