qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] qemu-coroutine-sleep: Silence Coverity warning


From: Peter Maydell
Subject: Re: [PATCH] qemu-coroutine-sleep: Silence Coverity warning
Date: Tue, 12 Nov 2019 09:56:27 +0000

On Mon, 11 Nov 2019 at 20:35, Eric Blake <address@hidden> wrote:
>
> Coverity warns that we store the address of a stack variable through a
> pointer passed in by the caller, which would let the caller trivially
> trigger use-after-free if that stored value is still present when we
> finish execution.  However, the way coroutines work is that after our
> call to qemu_coroutine_yield(), control is temporarily continued in
> the caller prior to our function concluding, and in order to resume
> our coroutine, the caller must poll until the variable has been set to
> NULL.  Thus, we can add an assert that we do not leak stack storage to
> the caller on function exit.
>
> Fixes: Coverity CID 1406474
> CC: Peter Maydell <address@hidden>
> Signed-off-by: Eric Blake <address@hidden>
> ---
>
> I don't know if this actually shuts Coverity up; Peter, since you
> reported the Coverity issue, are you in a better position to test if
> this makes a difference?  At any rate, the tests still pass after
> this is in place.

The only way to test is to commit it to master and wait for
the next run...

-- PMM



reply via email to

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