Re: [PATCH] vhost: zero vhost_vsock memory on allocation
From: Vitaly Mayatskih
Date: Thu Mar 28 2019 - 13:08:52 EST
On Thu, Mar 28, 2019 at 12:36 PM Stefan Hajnoczi <stefanha@xxxxxxxxxx> wrote:
> vsock->hash is only read if vsock->guest_cid has already been set and
> hence vsock->hash has been initialized too. I don't see where the
> problem is.
>
> Was your tree missing commit a72b69dc083a931422cc8a5e33841aff7d5312f2
> ("vhost/vsock: fix uninitialized vhost_vsock->guest_cid")?
>
> Are you sure the crash can be reproduced on linux.git/master?
You are right: we hit it on 4.14.91 while the guest_cid fix was
backported in 4.14.93.
Thus not a real issue. Sorry for confusion, vhost is something still new to me.
> Sounds good. Please send a v2 that also removes the explicit zero
> initialization since it's no longer needed with zalloc.
I changed my mind, all the rest is initialized explicitly, let's keep
it that way.
Will send the patch shortly.
--
wbr, Vitaly