From: Stefan Metzmacher Date: Fri, 8 May 2020 09:38:56 +0000 (+0200) Subject: vfs_io_uring: protect vfs_io_uring_fsync_completion() against invalid results X-Git-Tag: ldb-2.2.0~522 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c57a731c4ce395fd710f0b066cd6f1b72223ae07;p=thirdparty%2Fsamba.git vfs_io_uring: protect vfs_io_uring_fsync_completion() against invalid results We should never get back a value > 0. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14361 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_io_uring.c b/source3/modules/vfs_io_uring.c index 0ea785aae85..0b1583f962a 100644 --- a/source3/modules/vfs_io_uring.c +++ b/source3/modules/vfs_io_uring.c @@ -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); }