Skip to content

Commit a6d1f1a

Browse files
joannekoonggregkh
authored andcommitted
fuse: fix io-uring list corruption for terminated non-committed requests
commit 95c39ee upstream. When a request is terminated before it has been committed, the request is not removed from the queue's list. This leaves a dangling list entry that leads to list corruption and use-after-free issues. Remove the request from the queue's list for terminated non-committed requests. Signed-off-by: Joanne Koong <joannelkoong@gmail.com> Fixes: c090c8a ("fuse: Add io-uring sqe commit and fetch support") Cc: stable@vger.kernel.org Reviewed-by: Bernd Schubert <bschubert@ddn.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f6c08d3 commit a6d1f1a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/fuse/dev_uring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static void fuse_uring_req_end(struct fuse_ring_ent *ent, struct fuse_req *req,
8686
lockdep_assert_not_held(&queue->lock);
8787
spin_lock(&queue->lock);
8888
ent->fuse_req = NULL;
89+
list_del_init(&req->list);
8990
if (test_bit(FR_BACKGROUND, &req->flags)) {
9091
queue->active_background--;
9192
spin_lock(&fc->bg_lock);

0 commit comments

Comments
 (0)