diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2018-09-28 10:43:22 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-09-28 10:43:22 -0400 |
commit | 4c316f2f3ff315cb48efb7435621e5bfb81df96d (patch) | |
tree | 9b4f8eca3b8b9b0c4823bc65f6c28785bce15d8e /fs/fuse | |
parent | d2d2d4fb1f54eff0f3faa9762d84f6446a4bc5d0 (diff) |
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: Miklos Szeredi <mszeredi@redhat.com>
Reported-by: syzbot+ef054c4d3f64cd7f7cec@syzkaller.appspotmai
Fixes: 46c34a348b0a ("fuse: no fc->lock for pqueue parts")
Cc: <stable@vger.kernel.org> # v4.2
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index c2af8042f176..34976b42f3e1 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -1312,8 +1312,8 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file, | |||
1312 | } | 1312 | } |
1313 | list_move_tail(&req->list, &fpq->processing); | 1313 | list_move_tail(&req->list, &fpq->processing); |
1314 | __fuse_get_request(req); | 1314 | __fuse_get_request(req); |
1315 | spin_unlock(&fpq->lock); | ||
1316 | set_bit(FR_SENT, &req->flags); | 1315 | set_bit(FR_SENT, &req->flags); |
1316 | spin_unlock(&fpq->lock); | ||
1317 | /* matches barrier in request_wait_answer() */ | 1317 | /* matches barrier in request_wait_answer() */ |
1318 | smp_mb__after_atomic(); | 1318 | smp_mb__after_atomic(); |
1319 | if (test_bit(FR_INTERRUPTED, &req->flags)) | 1319 | if (test_bit(FR_INTERRUPTED, &req->flags)) |