Skip to content
Commit bc78abbd authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Miklos Szeredi
Browse files

fuse: Fix use-after-free in fuse_dev_do_read()



We may pick freed req in this way:

[cpu0]                                  [cpu1]
fuse_dev_do_read()                      fuse_dev_do_write()
   list_move_tail(&req->list, ...);     ...
   spin_unlock(&fpq->lock);             ...
   ...                                  request_end(fc, req);
   ...                                    fuse_put_request(fc, req);
   if (test_bit(FR_INTERRUPTED, ...))
         queue_interrupt(fiq, req);

Fix that by keeping req alive until we finish all manipulations.

Reported-by: default avatar <syzbot+4e975615ca01f2277bdd@syzkaller.appspotmail.com>
Signed-off-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Fixes: 46c34a34 ("fuse: no fc->lock for pqueue parts")
Cc: <stable@vger.kernel.org> # v4.2
parent 6bf4ca7f
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