[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/30] util/vhost-user-server: check EOF when reading payload
From: |
Stefan Hajnoczi |
Subject: |
[PULL 15/30] util/vhost-user-server: check EOF when reading payload |
Date: |
Fri, 9 Oct 2020 20:35:14 +0100 |
Unexpected EOF is an error that must be reported.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20200924151549.913737-9-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
util/vhost-user-server.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c
index 5a60e2ca2a..ec555abcb2 100644
--- a/util/vhost-user-server.c
+++ b/util/vhost-user-server.c
@@ -169,8 +169,10 @@ vu_message_read(VuDev *vu_dev, int conn_fd, VhostUserMsg
*vmsg)
};
if (vmsg->size) {
rc = qio_channel_readv_all_eof(ioc, &iov_payload, 1, &local_err);
- if (rc == -1) {
- error_report_err(local_err);
+ if (rc != 1) {
+ if (local_err) {
+ error_report_err(local_err);
+ }
goto fail;
}
}
--
2.26.2
- [PULL 05/30] block: move logical block size check function to a common utility function, (continued)
- [PULL 05/30] block: move logical block size check function to a common utility function, Stefan Hajnoczi, 2020/10/09
- [PULL 06/30] block/export: vhost-user block device backend server, Stefan Hajnoczi, 2020/10/09
- [PULL 08/30] MAINTAINERS: Add vhost-user block device backend server maintainer, Stefan Hajnoczi, 2020/10/09
- [PULL 07/30] test: new qTest case to test the vhost-user-blk-server, Stefan Hajnoczi, 2020/10/09
- [PULL 09/30] util/vhost-user-server: s/fileds/fields/ typo fix, Stefan Hajnoczi, 2020/10/09
- [PULL 10/30] util/vhost-user-server: drop unnecessary QOM cast, Stefan Hajnoczi, 2020/10/09
- [PULL 11/30] util/vhost-user-server: drop unnecessary watch deletion, Stefan Hajnoczi, 2020/10/09
- [PULL 12/30] block/export: consolidate request structs into VuBlockReq, Stefan Hajnoczi, 2020/10/09
- [PULL 13/30] util/vhost-user-server: drop unused DevicePanicNotifier, Stefan Hajnoczi, 2020/10/09
- [PULL 14/30] util/vhost-user-server: fix memory leak in vu_message_read(), Stefan Hajnoczi, 2020/10/09
- [PULL 15/30] util/vhost-user-server: check EOF when reading payload,
Stefan Hajnoczi <=
- [PULL 17/30] block/export: report flush errors, Stefan Hajnoczi, 2020/10/09
- [PULL 16/30] util/vhost-user-server: rework vu_client_trip() coroutine lifecycle, Stefan Hajnoczi, 2020/10/09
- [PULL 18/30] block/export: convert vhost-user-blk server to block export API, Stefan Hajnoczi, 2020/10/09
- [PULL 19/30] util/vhost-user-server: move header to include/, Stefan Hajnoczi, 2020/10/09
- [PULL 22/30] block: move block exports to libblockdev, Stefan Hajnoczi, 2020/10/09
- [PULL 23/30] block/export: add iothread and fixed-iothread options, Stefan Hajnoczi, 2020/10/09
- [PULL 20/30] util/vhost-user-server: use static library in meson.build, Stefan Hajnoczi, 2020/10/09
- [PULL 24/30] block/export: add vhost-user-blk multi-queue support, Stefan Hajnoczi, 2020/10/09
- [PULL 21/30] qemu-storage-daemon: avoid compiling blockdev_ss twice, Stefan Hajnoczi, 2020/10/09
- [PULL 25/30] tests/qtest: add multi-queue test case to vhost-user-blk-test, Stefan Hajnoczi, 2020/10/09