Message ID | cfafbb9a-9e47-2489-8c71-9a6bc0d40e80@I-love.SAKURA.ne.jp (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Not yet applied to fuse.git. But I assume it will be applied by Miklos... #syz fix: fuse: don't keep dead fuse_conn at fuse_fill_super().
On Wed, May 9, 2018 at 1:01 PM, Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote: > From 606d54cd24b5b00e7a7e3597aabbe89719defc56 Mon Sep 17 00:00:00 2001 > From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> > Date: Tue, 1 May 2018 13:12:14 +0900 > Subject: [PATCH] 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(). Thanks, applied. Miklos
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index ef30995..9b37cf8 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1179,6 +1179,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) fuse_dev_free(fud); err_put_conn: fuse_conn_put(fc); + sb->s_fs_info = NULL; err_fput: fput(file); err: