]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_io_uring: protect vfs_io_uring_fsync_completion() against invalid results
authorStefan Metzmacher <metze@samba.org>
Fri, 8 May 2020 09:38:56 +0000 (11:38 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 12 May 2020 19:53:45 +0000 (19:53 +0000)
We should never get back a value > 0.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14361

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_io_uring.c

index 0ea785aae857b5a96aaa0f3675fc3800da0740ae..0b1583f962a76b52d36ba0f457b0f0b96b5ec5c2 100644 (file)
@@ -715,6 +715,13 @@ static void vfs_io_uring_fsync_completion(struct vfs_io_uring_request *cur,
                return;
        }
 
+       if (cur->cqe.res > 0) {
+               /* This is not expected! */
+               DBG_ERR("got cur->cqe.res=%d\n", (int)cur->cqe.res);
+               tevent_req_error(cur->req, EIO);
+               return;
+       }
+
        tevent_req_done(cur->req);
 }