Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c316f2f authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

fuse: set FR_SENT while locked



Otherwise fuse_dev_do_write() could come in and finish off the request, and
the set_bit(FR_SENT, ...) could trigger the WARN_ON(test_bit(FR_SENT, ...))
in request_end().

Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Reported-by: default avatar <syzbot+ef054c4d3f64cd7f7cec@syzkaller.appspotmai>
Fixes: 46c34a34 ("fuse: no fc->lock for pqueue parts")
Cc: <stable@vger.kernel.org> # v4.2
parent d2d2d4fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1312,8 +1312,8 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file,
	}
	list_move_tail(&req->list, &fpq->processing);
	__fuse_get_request(req);
	spin_unlock(&fpq->lock);
	set_bit(FR_SENT, &req->flags);
	spin_unlock(&fpq->lock);
	/* matches barrier in request_wait_answer() */
	smp_mb__after_atomic();
	if (test_bit(FR_INTERRUPTED, &req->flags))