qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] Stop vhost-user sending uninitialized mmap_offsets


From: Michael S. Tsirkin
Subject: Re: [PATCH v2] Stop vhost-user sending uninitialized mmap_offsets
Date: Tue, 23 Jun 2020 05:07:22 -0400

On Tue, Jun 23, 2020 at 09:58:23AM +0100, Peter Maydell wrote:
> On Tue, 23 Jun 2020 at 00:50, Raphael Norwitz
> <raphael.norwitz@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.maydell@linaro.org>
> > Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
> > ---
> 
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> thanks
> -- PMM

Queued, thanks!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]