On Tue, 23 Jun 2020 at 00:50, Raphael Norwitz
<raphael.norw...@nutanix.com> wrote:
>
> Prior to this change, the vhost_user_fill_msg_region function filled out
> all elements of the VhostUserMemoryRegion struct except the mmap_offset.
>
> This function is often called on uninitialized structs, which are then
> copied into VHOST_USER_SET_MEM_TABLE and VHOST_USER_ADD/REM_MEM_REG
> messages. In some cases, where the mmap_offset was not needed, it was
> left uninitialized, causing QEMU to send the backend uninitialized data,
> which Coverity flagged as a series of issues.
>
> This change augments the vhost_user_fill_msg_region API, adding a
> mmap_offset paramenter, forcing the caller to initialize mmap_offset.
>
> Fixes: ece99091c2d0aeb23734289a50ef2ff4e0a08929
> Fixes: f1aeb14b0809e313c74244d838645ed25e85ea63
> Reported-by: Coverity (CIDs 1429802, 1429803 and 1429804)
> Suggested-by: Peter Maydell <peter.mayd...@linaro.org>
> Signed-off-by: Raphael Norwitz <raphael.norw...@nutanix.com>
> ---


Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>

thanks
-- PMM

Reply via email to