crosvm/third_party
Keiichi Watanabe 5b456d31f9 vmm_vhost: slave_req_hander: Wait before vhost-user message body
When vhost-user front-end send a vhost-user message via Unix domain
socket, a message header is sent first with optional attached files.
Then, a message body is sent as a separate packet if necessary.
However, the existing implementation blocks only before a
message header coming and assumed that the message body is ready when
the header comes. So, there was a race and `handle_request` could return
`EAGAIN`.

This CL splits SlaveReqHandler::handle_request() into recv_header() and
process_message() so a caller can wait between the header and the
additional payload.

On VVU, we shouldn't wait before receiving the payloads because the
proxy device forwards a header and its message body together. So we
check the protocol in needs_wait_for_payload().

BUG=b:237891754
TEST=Run vhost-user block on Linux
TEST=Run vhost-user block on Windows
TEST=Run VVU block on Linux

Change-Id: I35af3eb0e706cb005bf697397698e01e272b0704
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3863050
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-24 04:21:56 +00:00
..
depot_tools@268d645853 health-check: Add infra checks 2022-08-18 00:17:04 +00:00
libslirp-rs net_util: Add windows slirp support 2022-10-11 15:25:38 +00:00
minigbm@ef852e007c Uprev all submodules 2021-10-19 19:12:53 +00:00
minijail@77c59db8ff Revert "third_party/minijail: update to latest main" 2022-08-09 23:00:30 +00:00
virglrenderer@4770f706db virglrenderer: Add cross-domain support 2022-05-20 20:49:55 +00:00
vmm_vhost vmm_vhost: slave_req_hander: Wait before vhost-user message body 2022-11-24 04:21:56 +00:00