Skip to content

Commit 543b8f8

Browse files
Tetsuo HandaMiklos Szeredi
authored andcommitted
fuse: don't keep dead fuse_conn at fuse_fill_super().
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]>
1 parent 6becdb6 commit 543b8f8

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
@@ -1193,6 +1193,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
11931193
fuse_dev_free(fud);
11941194
err_put_conn:
11951195
fuse_conn_put(fc);
1196+
sb->s_fs_info = NULL;
11961197
err_fput:
11971198
fput(file);
11981199
err:

0 commit comments

Comments
 (0)