summaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-09-28 16:43:22 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-21 09:19:14 +0100
commitc1ef6c983a0026e670700c1c192c6b6edebfcba9 (patch)
tree9faa02c48ee77319c249e9b2ed28005fa8c0e9ce /fs/fuse
parent1ed087a7d75f5cc96edafebb0eeb5a3dce515374 (diff)
downloadlinux-stable-c1ef6c983a0026e670700c1c192c6b6edebfcba9.tar.gz
linux-stable-c1ef6c983a0026e670700c1c192c6b6edebfcba9.tar.bz2
linux-stable-c1ef6c983a0026e670700c1c192c6b6edebfcba9.zip
fuse: set FR_SENT while locked
commit 4c316f2f3ff315cb48efb7435621e5bfb81df96d upstream. 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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 09c4ab120422..51eb602a435b 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1319,8 +1319,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))