Skip to content

Commit 3a37d85

Browse files
Tetsuo Handagregkh
authored andcommitted
fuse: don't keep dead fuse_conn at fuse_fill_super().
commit 543b8f8 upstream. syzbot is reporting use-after-free at fuse_kill_sb_blk() [1]. Since sb->s_fs_info field is not cleared after fc was released by fuse_conn_put() when initialization failed, fuse_kill_sb_blk() finds already released fc and tries to hold the lock. Fix this by clearing sb->s_fs_info field after calling fuse_conn_put(). [1] https://syzkaller.appspot.com/bug?id=a07a680ed0a9290585ca424546860464dd9658db Signed-off-by: Tetsuo Handa <[email protected]> Reported-by: syzbot <[email protected]> Fixes: 3b463ae ("fuse: invalidation reverse calls") Cc: John Muir <[email protected]> Cc: Csaba Henk <[email protected]> Cc: Anand Avati <[email protected]> Cc: <[email protected]> # v2.6.31 Signed-off-by: Miklos Szeredi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2f7bf36 commit 3a37d85

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/fuse/inode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
11761176
fuse_dev_free(fud);
11771177
err_put_conn:
11781178
fuse_conn_put(fc);
1179+
sb->s_fs_info = NULL;
11791180
err_fput:
11801181
fput(file);
11811182
err:

0 commit comments

Comments
 (0)